Abhilash

Hi!

I am developing a tool based on vb.net. in one of the procedures, i need the path to the folder where the tool will be located as i need to access an excel file which will be located in the same folder.

Is there any method to get this path other than getting it from the user.

Please advise

cheers

Abhilash



Re: Visual Basic General How to find the path to the current directory where the program is located?

Mattias Sjogren

Checking the System.Windows.Forms.Application.StartupPath property.






Re: Visual Basic General How to find the path to the current directory where the program is located?

weirdbeardmt

Directory.GetCurrentDirectory




Re: Visual Basic General How to find the path to the current directory where the program is located?

Mattias Sjogren

The "current directory" returned by Directory.GetCurrentDirectory can change during the lifetime of the application, and it isn't necessarily the same as the application directory.






Re: Visual Basic General How to find the path to the current directory where the program is located?

weirdbeardmt

my.Application.Info.DirectoryPath then.

Mattias Sjogren wrote:

The "current directory" returned by Directory.GetCurrentDirectory can change during the lifetime of the application, and it isn't necessarily the same as the application directory.






Re: Visual Basic General How to find the path to the current directory where the program is located?

Abhilash

HI!

thx for your help.. actually wad i want is that i need to place an excel file along with my application's exe file.. the data inside this excel file will be used by my application.. dats why to find the excel file i need the path to the location of the exe file..

another help i need to know how to create the exe file of my application.. i am still in debug mode and since this is my first application.. i dun know how to publish it or build solution.. can u please tell me the procedure for this... thank u

cheers

Abhilash