Visual Basic .NET Forums  
Click here to advertise with us

Go Back   Visual Basic .NET Forums > VB.NET > Windows Forms

Windows Forms Discussion related to Winforms application development

VB.NET Forums Newsletter Signup:
Email address:


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 07-05-2009, 12:13 PM
VB.NET Forum Newbie
.NET Framework: .NET 3.0 (VS 2005/2008)
 
Join Date: May 2009
Age: 24
Posts: 9
Reputation: 0
dimmu is on a distinguished programming path ahead
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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 07-05-2009, 12:23 PM
VB.NET Forum Enthusiast
.NET Framework: .NET 2.0 (VS 2005)
 
Join Date: Apr 2008
Posts: 84
Reputation: 31
ggunter is on a distinguished programming path ahead
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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 07-05-2009, 12:41 PM
VB.NET Forum Newbie
.NET Framework: .NET 3.0 (VS 2005/2008)
 
Join Date: May 2009
Age: 24
Posts: 9
Reputation: 0
dimmu is on a distinguished programming path ahead
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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 07-05-2009, 2:49 PM
VB.NET Forum Newbie
.NET Framework: .NET 3.0 (VS 2005/2008)
 
Join Date: May 2009
Age: 24
Posts: 9
Reputation: 0
dimmu is on a distinguished programming path ahead
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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On





All times are GMT -4. The time now is 12:59 PM.

Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.2


For advertising opportunities click here.