Try the code segments below. You can grab other
information out of the "Application" object as well.
I hope this answers your question.
Dennis Vansickle
-----Original Message-----
In VB .Net I can get the current directory using the
CurDir() function. Does C# have a similar function.
string str = String.Empty;
System.IO.DirectoryInfo curPath;
System.IO.FileInfo[] fis;
System.IO.DirectoryInfo[] dis;
curPath = new System.IO.DirectoryInfo
(Application.StartupPath);
dis = curPath.GetDirectories();
fis = curPath.GetFiles();
foreach (System.IO.DirectoryInfo di in dis)
str += di.Name + "\n";
foreach (System.IO.FileInfo fi in fis)
str += fi.Name + "\n";
MessageBox.Show(str);
Or how can I discover the current path in C#?
.
MessageBox.Show("Current Path = " +
Application.StartupPath);