accessing to a folder

dimmu

Member
Joined
May 28, 2009
Messages
9
Programming Experience
Beginner
hello everyone,
i have a question (stupid one -_-')
how to access to a folder created inside the project from the code.
i want, once the program installd in the machine it access to that folder and then access to the files which i want.
i tried this :
My.Application.Info.DirectoryPath() & "\Docs\a.doc
it works well in the developpment phase, but once the application is installed, it doesn't work.
it seems that the directoryPath change after installing the program.
help please !!

thank you in advance.
 
Assuming that your program structure is:
"\executable file directory\Docs"


Then it would be:
Dim strPath As String = Directory.GetCurrentDirectory() & "\Docs\a.doc"


Make sure you import System.IO.
 
i have the same problem after trying your idea.
before installing it works well, when i displayed the dirctory path :
C:\Documents and Settings\Mehdi\Mes documents\Visual Studio 2008\Projects\Project_Presentation\Project_Presentation\bin\Debug
after installing :
C:\Documents and Settings\Mehdi\Local Settings\Apps\2.0\BZ33CAEJ.9MK\HJVEBRL9.R3P\proj..tion_4c73574e085bcb8f_0001.0000_47df9090ebe790f8
where there is no folder which contains the docs.

what shall i do ?

thank you
 
i want to be sure if i put the directory which contains the files on the proper way.

what i did is :
I clicked (right button) on my project ==> Add new folder.
I clicked (right button) on the new folder ==> Add Existing Item ==> and i added the files.


in the code of my program i wrote :
WebBrowser1.Url = New Uri(Directory.GetCurrentDirectory & "\Docs\" & "a.doc")

it works fine before creating the install (using the publish wizard of visual basic express)

did i miss something ??

thank you.
 
Back
Top