0

I completed my winform application.

I want to add a csv file. So my application will reach with this path.

How can I get published locastion's path?

Mehmet
  • 2,256
  • 9
  • 33
  • 47

2 Answers2

1

I think you mean following with published locations:

Environment.CurrentDirectory
Environment.GetFolderPath(...) 

with one of following parameter

SpecialFolder.ApplicationData
SpecialFolder.Desktop
...

etc.

See http://msdn.microsoft.com/en-us/library/system.environment.specialfolder.aspx

George Mamaladze
  • 7,593
  • 2
  • 36
  • 52
0

If you programmatically want to get your form's execution path to access your CSV, use

string path = (new System.Uri(Assembly.GetExecutingAssembly().CodeBase)).AbsolutePath; inside your form.

and then Path.Combine(path, CSVFilename);

Alex
  • 7,901
  • 1
  • 41
  • 56