HI Friends,
I am trying to call the windows forms through menu strip.
In menu strip items i have written the following code
which reads a text file "rep_path.txt".
the text file contains only line d:\\reports\\
on cliking of this menu item it shows the following exception and message.
An unhandled exception of type 'System.ComponentModel.Win32Exception' occurred in System.dll
Additional information: The system cannot find the file specified
but if i use the path directly for the filename then it is working.
myProcess.StartInfo.FileName = "d:\\reports\\sale_prod.exe";
plz give the solution for this problem.
thanks and regards
Madhu
I am trying to call the windows forms through menu strip.
In menu strip items i have written the following code
which reads a text file "rep_path.txt".
the text file contains only line d:\\reports\\
private void SALEPRODToolStripMenuItem_Click(object sender, EventArgs e) { string str = System.IO.File.ReadAllText(@"d:\rep_path.txt"); Process myProcess = new Process(); myProcess.StartInfo.FileName = str+"sale_prod.exe"; myProcess.Start(); }
on cliking of this menu item it shows the following exception and message.
An unhandled exception of type 'System.ComponentModel.Win32Exception' occurred in System.dll
Additional information: The system cannot find the file specified
but if i use the path directly for the filename then it is working.
myProcess.StartInfo.FileName = "d:\\reports\\sale_prod.exe";
plz give the solution for this problem.
thanks and regards
Madhu