|
-
June 13th, 2005, 11:14 PM
#1
App.path in .net
there was App.path in vb6 to indicate the application folder..how to do this in vb.net???
-
June 14th, 2005, 12:35 AM
#2
Re: App.path in .net
 Originally Posted by shuvo
there was App.path in vb6 to indicate the application folder..how to do this in vb.net???
System.Reflection.Assembly.GetExecutingAssembly.Location --> This will give you the whole path including the exe name..
There is no App object present in .NET so you will have to look through MSDN to find out wat are the different equivalents of App object...
-
June 14th, 2005, 01:42 AM
#3
Re: App.path in .net
Application.StartupPath
This gives the path of Application Executable excluding the exe file name.
Hope this helps.
-
June 14th, 2005, 03:36 AM
#4
Re: App.path in .net
U can get the name of the executable file by your defined code..but it is not useful when u want to open a file like a Dat file or Txt file then u will need the specific address string like we used to get App.path\text.txt.How do I get that?
-
June 14th, 2005, 04:08 AM
#5
Re: App.path in .net
Application.StartupPath & "\text.txt".
This will give you the file from the apllication folder i.e. BIN folder.
See EXCLUDING in last reply
-
June 14th, 2005, 04:10 AM
#6
Re: App.path in .net
yes Amit...I didn't see ur Reply before my last reply...ur solution solved my problem..thanx a lot.
-
June 14th, 2005, 10:40 PM
#7
Re: App.path in .net
When constructing PATH, use System.IO.Path.Combine() method.
Good Luck,
-Cool Bizs
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|