C
cu.4m.srinivas
Hi all,
I want to get the process running in the 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
anyInvalidOperationException).
when i try to print the parameters other than that of StartInfo's, its
working fine; only in case of StartInfo params like FileName and
Arguments, it's returning "null".
Can anyone help me out in this ???
I want to get the process running in the 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
anyInvalidOperationException).
when i try to print the parameters other than that of StartInfo's, its
working fine; only in case of StartInfo params like FileName and
Arguments, it's returning "null".
Can anyone help me out in this ???