+ Reply to Thread
Results 1 to 4 of 4

Thread: accessing to a folder

  1. #1
    dimmu is offline VB.NET Forum Newbie dimmu is on a distinguished programming path ahead
    .NET Framework
    .NET 3.0 (VS 2005/2008)
    Join Date
    May 2009
    Age
    25
    Posts
    9
    Reputation
    0

    Default accessing to a folder

    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.

  2. #2
    ggunter is offline VB.NET Forum Enthusiast ggunter is on a distinguished programming path ahead
    .NET Framework
    .NET 2.0 (VS 2005)
    Join Date
    Apr 2008
    Posts
    97
    Reputation
    38

    Default

    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.

  3. #3
    dimmu is offline VB.NET Forum Newbie dimmu is on a distinguished programming path ahead
    .NET Framework
    .NET 3.0 (VS 2005/2008)
    Join Date
    May 2009
    Age
    25
    Posts
    9
    Reputation
    0

    Default

    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_Present ation\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

  4. #4
    dimmu is offline VB.NET Forum Newbie dimmu is on a distinguished programming path ahead
    .NET Framework
    .NET 3.0 (VS 2005/2008)
    Join Date
    May 2009
    Age
    25
    Posts
    9
    Reputation
    0

    Default

    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.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts