C
cu.4m.srinivas
Hi all,
I want to do the foll.
I want to get the process running in the name system, with name "abc",
and in turn get their arguments, so that i do some processing later
Foll. is my code:
Process proc = new Process();
proc.StartInfo.FileName = "notepad.exe";
proc.StartInfo.Arguments = "abc.cs";
proc.StartInfo.UseShellExecute = false;
proc.Start();
Process[] p = Process.GetProcessesByName("notepad");
string args = p[0].StartInfo.Arguments.ToString();
Console.WriteLine("args: " + a); //this is retning null - shd retn
abc.cs
string b = p[0].BasePriority.ToString();
Console.WriteLine("BASE PRIORITY: "+ b); //this comes out correctly
With the above code, args is returnin a null string. (Also abc is
currently running-obvious 'coz i didnt get any
InvalidOperationException). when i try to print the parameters other
than that of StartInfo, its working fine-only in case of StartInfo
params.
I want to do the foll.
I want to get the process running in the name system, with name "abc",
and in turn get their arguments, so that i do some processing later
Foll. is my code:
Process proc = new Process();
proc.StartInfo.FileName = "notepad.exe";
proc.StartInfo.Arguments = "abc.cs";
proc.StartInfo.UseShellExecute = false;
proc.Start();
Process[] p = Process.GetProcessesByName("notepad");
string args = p[0].StartInfo.Arguments.ToString();
Console.WriteLine("args: " + a); //this is retning null - shd retn
abc.cs
string b = p[0].BasePriority.ToString();
Console.WriteLine("BASE PRIORITY: "+ b); //this comes out correctly
With the above code, args is returnin a null string. (Also abc is
currently running-obvious 'coz i didnt get any
InvalidOperationException). when i try to print the parameters other
than that of StartInfo, its working fine-only in case of StartInfo
params.