Setting Data File Paths Per App Path?

Aug 23, 2010

I am working on a project that consists of manipulating several reports (word and excel). At the beginning of my project I set all paths to a hard string (C:users...................) using the my.settings. Worked great during developement but now its time to test on other machines. I have been toying with using Application.StartupPath but cannot figure out how to modify the app.config so I do not have to recode my forms (given it would not take long), not to sound lazy but I know there has to be a way to achieve a computer specific path to find the reports in the application directory.

View 8 Replies


ADVERTISEMENT

File I/O And Registry :: FileVersionInfo.GetVersionInfo(path) Properties - On Some Paths

Jun 21, 2010

Using FileVersionInfo.GetVersionInfo(path), I get what I need most of the time. All the properties are there. But... I have this one folder that most of the properties for this object are NOTHING... except the [Name] property.

[Code]....

View 2 Replies

ASP.NET Setting A Path For File With VB?

May 30, 2011

So this is a pretty dumb question, and one I am clearly misunderstanding for whatever the reason. I have an ASP.net project and the default aspx page loads a file. I made a class to deal with file handling, in it I hard coded the local directory to where that file is. I want to make that path relative to the default.aspx page. I can't figure out how to do that. I have read a lot of stuff on MSDN, and it makes simple sense, but when I put it to code I can't seem to get it right.

I feel my answer is here, I understand what it is saying but I can't translate that to my program.[URL] Code such as

Dim rootPath As String = Server.MapPath("~")

makes sense to me but I can't use 'Server' for some reason.

I have used this spot of code to supplement my problem for now.

string=System.AppDomain.CurrentDomain.BaseDirectory()

View 1 Replies

Setting A Default File Path?

Nov 14, 2011

how would i go about setting a defualt file path for when i open a document? Basically im opening a file from this filepath Dim SavePath As String = "C:VBWorkBook 6Assignment 6Assignment 6Assignment 6Quotes.xml "But if i were to run this program on another computer, how would i change the directory path so it wouldnt be specific to my pc?

View 1 Replies

Where To Save Data Such As Passwords And File Paths

Jan 13, 2010

First of all, using VB 2008.I'm writing my first VB program that will actually do anything, so I am about as noob as noob can get. I'll try to keep my question as simple as possible.

My program will have a password protected screen, but rather than "hard-coding" a password into the program, I'd like to give the user the option of changing the password to whatever he'd like. Obviously, without hardcoding the password into the program, this value would need to be stored somewhere outside the program in order for it to be available the next time the program is executed.

I know that the Windows registry is a place to save data like that, but are there other places (certain types of files, etc.) where this data is typically stored? I'm writing this program for work, and I'm not sure that my IT department will look favorably upon me messing around with the registry.

View 6 Replies

VS 2008 Setting The Path Of Image File?

Jan 20, 2010

I'm been a while since i use this VB2008, now i forgot the right syntax how can i put a code on how to set the path of an image..

[code]...

something like that, SO hard that to transfer my project files into the other PC without VB2008 and not working the path cause they need to change it the path again for changes.what i want is:Is there a code for automatically read the specific path so that can transfer my project files in other drive or PC without changing the path...

View 2 Replies

Path Of .zip file Has Spaces In It / It's Not Recognizing Path As Valid Path

Aug 22, 2006

I have a Access program and I'm using VBA code in the background to run Winunzip using shell command. Well, the path of the .zip file has spaces in it and it's not recongizing the path as a valid path. Is there a another way to tackle this problem besides the shell?I can't us pkzip either. Has you can see I had to use progra~1 instead of Program Files.[code]

View 2 Replies

Setting The Path For A New Project?

Jun 11, 2011

I'm new to VB .Net and I've searched for this info in the help files, but couldn't find it.When I save a project it automatically saves it to "C:Documents and SettingsusernameLocal SettingsApplication DataTemporary Projectsfilename".I want to be able to set this path ahead of time to where I want it to go. I've set a path in the Tools > Options > Projects and Solutions > General tab (under Project Location), but it doesn't use it.

View 2 Replies

Exact Path To Pull Data From Bin File?

Apr 8, 2010

I am working on a VB.Net project and trying to get it to pull data from a database. I have the data base located in my bin folder with in the project but I do not know the exact path how to do it. The code that I am using is noted below

Private Sub btnTotalTravelCost_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnTotalTravelCost.Click
'strsql is a sql statement that selects all the fields from the
'ApprovedTravelRequest table
Dim strSql As String = "SELECT * FROM ApprovedTravelRequests "
'strPath provides the database type and path of the Travel database.
[Code] .....

I want to pull the data from the Bin File. I know the current location shown is incorrect.

View 2 Replies

C# - Setting ProcessStartInfo.WorkingDirectory To An UNC Path?

Apr 6, 2010

I have a utility that I have written in VB.net that runs as a scheduled tasks. It internally calls another executable and it has to access a mapped drive. Apparently windows has issues with scheduled tasks accessing mapped drives when the user is not logged on, even when the authentication credentials are supplied to the task itself. Ok, fine.

To get around this I just passed my application the UNC path.

process.StartInfo.FileName = 'name of executable'
process.StartInfo.WorkingDirectory = '\unc path'
process.StartInfo.WindowStyle = ProcessWindowStyle.Hidden
process.StartInfo.Arguments = 'arguments to executable'
process.Start()

This is the same implementation I used with the mapped drive, however using the UNC path, the process is not behaving as if the UNC path is the working directory.

Are there any known issues setting ProcessStartInfo.WorkingDirectory to an UNC path?

View 1 Replies

Setting A Relative Path For A Database?

Jun 11, 2010

i have so far set up a form to save data into a database and i am using:

[Code]....

View 4 Replies

Setting A Relative Path To A Database?

Mar 11, 2010

i have so far set up a form to save data into a database and i am using:

con.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0.;" & _
"Data Source = F:Database1.mdb"
con.Open()

I tried saving the database as i did with images in the resource folder and used my.resources but this didnt work is there any way i can save the database into the project folder and link to it no matter whan machine i am on?

View 5 Replies

Setting Local Path With My.Settings

Dec 16, 2010

I am using My.Settings to store the path of my crystal reports. Now I wish to place my crystal reports within local execute path. So how do I set within My.Settings to detect the local run path?I tried putting application.localuserappdatapath in application settings which return back as a string.

View 2 Replies

VS 2008 Setting A Document Path?

May 26, 2009

I got a button that needs to open a word file, and because the file is on a network it freezes for the first time you press it. If I would put the file in the destination of the Bin next to the exe files how would I define the location to it. If the bin folder would get moved to another location, the path will differ.So how would I be able to create a bit flexible path wherever the application goes?

Private Sub btnWarranty_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnWarranty.Click
Dim wDoc As Word.Document
Dim wWord As Word.Application = New Word.Application
Dim path As String = "\SERVERPublicCRM_LibraryPolicywarranty.doc"
wDoc = wWord.Documents.Open(path, OpenAccess.Read)
End Sub

View 6 Replies

Setting Path Of Associated Files For Installation Package?

Jul 5, 2010

I have a .chm file linked to my app that is presently being called from it's actual location.HelpProvider1.HelpNamespace = C:Documents and SettingsmgfranzMy DocumentsVisual Studio 2008ProjectsApp NameCleanUp.chm

But when I package the app the directory is going to change to C:Program FilesApp Name by default. The problem arises if the user decides to create an alternate directory. Is there a way to set a $Path at setup runtime so that when the .chm file is called it knows to look in the Home installation directory? Here is the code I use to call the .chm; Private Sub PictureBox1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles PictureBox1.Click

[Code]...

View 2 Replies

VS 2008 - Setting Database Path From Form?

May 18, 2009

I have an application that's going to be portable so it's likely the path of the database itself (access mdb file) will change so hard wiring the path in the app.config isn't practical. I would like to create a 'Settings' form for the user to enter the path (browse for would be ideal but I can figure that out later) of the database file and save it for future use with the same app. I've found a few things out there talking about creating a new app.config file alongside the original with a 'key' defined but I'm not sure how that relates to the original app.config and how it would call the new variable to make the connection.

View 3 Replies

Load Text File Of Mp3 File Paths To Listbox?

Mar 7, 2011

I am trying to load a text file into a list box in order to be able to play the files see code below I have an error on this line Which states Error 1 Value of type 'String' cannot be converted to '1-dimensional array of String'.

Dim Open As New OpenFileDialog
Dim myStreamReader As System.IO.StreamReader
Open.Filter = "Text [*.txt*]|*.txt|All Files [*.*]|*.*"

[code]....

View 7 Replies

Add File Paths To A CheckedListBox?

Feb 4, 2011

The end result I am looking for is I want to add File Paths to a CheckedListBox. I only want certain file extensions and if a file by the same name but a specific extension exsists allready then I do not want to add those files to the CheckedListBox.

Example: I am only wanting these filetypes in my CheckedListBox (.gif, .tif, .bmp, and .jpg).However if the filetype (.PNG) allready exsists with the same filename (i.e. image. png and image.jpg) I then do NOT want to add that JPG. Only files that do not allready have a PNG with the same name. (I hope I was able to make this clear)

My current code will add the filetypes (.gif, .tif, .bmp and .jpg) to the CheckedListBox. However I do not know how to have the code only add the files that don't have the PNG.Here is my current code:[code].....

View 2 Replies

Delete File On Server From A File Path From A Sql Database File Path?

Feb 4, 2010

I am having a big problem with deleteing a file form the server. I have the filename for a image stored in my SQL database. the problem is i am getting an error of "Illegal characters in path. " Here is the code below:Everything is working fine until the delete command.

Protected Sub DeleteButton_Click(ByVal sender As Object, ByVal e As System.EventArgs)
Dim tmpEquipID As String = Request("EquipID")
Dim tmpImageID As String = (CType(FormView1.FindControl("ImageIDLabel"), Label).Text)
Dim d As New equippicsDataContext

[code]....

View 3 Replies

File Paths And Song Length?

Apr 27, 2012

Im fooling around with the Windows Media Player control in Visual Studio 11 (Beta) and I'm wondering how to

1. How to get the path to a folder, and then add all the paths of the files in that folder into an ArrayList

2. How can I get the length of the current .mp3 file that's playing in the Windows Media Player control?

View 5 Replies

How To Play Files From File Paths

Oct 11, 2009

I'm trying to write a program that allows you to; 1) open a mp3 or wav file via the user finding the file and copying the file path and pasting it into a text box and, 2) by pressing a button it will play the desired file, and then 3) by pressing another button it will stop playing the file. I've already have this under pat,

Private Sub cmdOne_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdOne.Click
My.Computer.Audio.Play(My.Resources.buzzer, AudioPlayMode.Background)
End Sub

View 1 Replies

Keep File Paths Across Multiple Computers If Everything Is In It?

Nov 16, 2009

I am working on a project and transferring the whole project back and forth. The thing is I am using a full file path in all my code ("c:/Users/..."), so when I transfer to the other computer the file paths break. Everything I am linking to is in the "bin" folder in my project's folder. How do I have file paths relative to the project folder?

View 2 Replies

File Paths On A Sever / DB Connections Strings?

Jun 1, 2008

I am coding this app on my home pc, but when complete it will be run on individual pc(s) (each pc has it oun HD) on a local network. I have a world of questions but right now how do I set the path to my database? is there a way to set a default if its not found.Database(s) that the app use's are stored in a folder on the server. i.e.: P:MyServerNameDeptFolderData for example.OLEDB or TableAdapters which would be the better choice.I understand that MS Access DB is rather resticting.

View 3 Replies

Rogue Spaces Appearing In File Paths?

Jun 5, 2010

I've started a reader for map files for a small turn based game.However, when it attempts to create a tiles string array, but tiles(0,1) through to tiles(0,9) all precede the filename (3.jpg) with a space.

Normal path: C:\path\tiles\3.jpg
Path with rogue spaces (that I can't figure out how to remove): C:\path\tiles\ 3.jpg

Code to read from the file
----------------------------------
Imports System.IO
Public Class Form1

[code]....

View 10 Replies

Save The New File/folder Paths To My.settings?

Apr 22, 2011

i have loaded my application settings into 3 text boxes. now if the user changes these, how do i save the new file/folder paths to my.settings? i tried my.settings.save but it does not seem to work.

'Load the current options
Dim MyConnectionString As String = My.Settings.PrimaryConnectionString
Dim MyDefaultImportFolder As String = My.Settings.DefaultImportFolder

[Code]......

View 2 Replies

Using Long File Paths To Execute A Program?

Jul 20, 2010

I am trying to execute a program with switches that ends up with a shortcut being too long and exceeds the 260 character limit for shortcuts in windows XP:

[Code]...

View 8 Replies

VS 2008 Updating .mdb Table With File Paths

Oct 13, 2009

I am making an appilcation which displays images from a target folder. It was orginally using an sql .sdf file as its data source but the data source has been changes to a .mdb access database.The code does not seen to update the tabe, and being pretty new to this would like some help on how to do this as currently the code is stating the following error:Object reference not set to an instance of an object.This is the code which allows the customer to choose a target folder to display the file images, but the files will not update to the database: [code]

View 3 Replies

VS 2010 - External File Paths (USB Stick)

Aug 27, 2011

I am trying to write a simple standalone windows forms project that basically contains various buttons which run external application setup files. The problem is I want to be able to run it from a USB stick. I have created a folder inside the project with all the files I need to call in it. I am using Process.start but the paths are obviously going to be wrong when the project is running from the stick as the drive letter may be different each time. How do I over come this.

View 1 Replies

[2008] Contracting File Paths In A Textbox

Feb 16, 2009

I've search for this, but haven't come up with anything. Anyhow, I'm wanting to do something along the lines of contracting the path so you see the start and end, along the lines of:

[Code]...

View 3 Replies

Forms :: Make Web Browser Accept Only File Paths?

Jul 29, 2010

How would I make my web browser accept only file paths? It's a little import manager for a program that I am making, allowing the user to import files, but I dont want but reports that say that they can access google or something through it.

View 8 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved