4
Answers

How to handle exeception throw from a method from anohter? {Continues...}

Photo of petre ricardo

petre ricardo

15y
2.2k
1

in class A, i have a caller method P1 that called methods P2, P3 of the same class.
P2 throw two exeptions and P3 throw another exception
P1 is called by anohte method of another class. However, in P1, how should i handle the exception returned by P2, and P3?
 
 

Answers (4)

0
Photo of Trinity
NA 217 0 15y
You can try this code

string BasePath = Application.StartupPath.ToString();
BasePath = Application.UserAppDataPath;
string ResultingPath = System.IO.Path.Combine(BasePath,"%your application name here%");
System.Diagnostics.Process.Start(ResultingPath);

Accepted
0
Photo of Trinity
NA 217 0 15y
Ok then mark it as answered
0
Photo of ic ic
NA 85 0 15y

I got it going :) Thank You All
string root = Application.StartupPath;
string exePath = System.IO.Path.Combine(root, "i:\\app\\test\\WAREH004.exe");
string argPath = System.IO.Path.Combine(root, "i:\\app\\test\\WAREH004.INI");
Process.Start(exePath, argPath + " 1");
0
Photo of Trinity
NA 217 0 15y

But this path is incorrect

P:\\test\\C#\\WAREH004.exe P:\\test\\C#\\WAREH004.INI 1?!!!
0
Photo of ic ic
NA 85 0 15y

Apologies for the late reply - Thank You for Assisting.
I get the Error: Cannot find the specified path
string BasePath = Application.StartupPath.ToString();
BasePath =
Application.UserAppDataPath;
string ResultingPath = System.IO.Path.Combine(BasePath, "P:\\test\\C#\\WAREH004.exe P:\\test\\C#\\WAREH004.INI 1");
System.Diagnostics.Process.Start(ResultingPath);
I can start - run - location then the program comes up.
Please Assist