Quantcast
Viewing all articles
Browse latest Browse all 12583

Debug Error

I have a winform where I open folders that are stored on a network drive.  I have the path hardcoded into the code and all the user inputs is the folder name.  The problem I am running into is that in order to open consecutive folders you have to close the win form or you get an error?!

try
{
string folderToOpen = txtBox1.Text;
System.Diagnostics.Process rrrr = new Process();
rrrr.StartInfo.FileName = "Location" + folderToOpen;
rrrr.StartInfo.UseShellExecute = true;
rrrr.Start();
txtBox1.Text = "";
}
catch (Exception ex)
{
MessageBox.Show(ex.ToString());
}

And what the Exception shows is this System.ComponentModel.Win32Exception(0x80004005): The system can not find the file specified at System.Diagnostics.Process.StartWithShellExecute(rocessStartInfostartInfo) at System.Diagnostics.Process.Start.

The folder is valid, and it is in the location being shown in the code.  What is causing this, or even better how can I get around this?


Viewing all articles
Browse latest Browse all 12583

Trending Articles