Amal
Amal

Reputation: 586

How to get the current directory?

I want to access the current directory like below "E:WindowsFormsApplication17

but i am getting the directory as like below "E:\\BugBursters\\BuildUtility\\WindowsFormsApplication17\\bin\\Debug"

I have used the below code Directory.GetCurrentDirectory()

Please let me know how to resolve this.

Thanks and Regards, Amal Raj

Upvotes: 0

Views: 2271

Answers (1)

Beldi Anouar
Beldi Anouar

Reputation: 2180

Use this code :

For get your path :

string sourcePath =System.Reflection.Assembly.GetExecutingAssembly().Location

Upvotes: 2

Related Questions