this is testquery

this is testquery

19 Feb 2010 12:02:37

Hi ,

 

Tets question

 

thank you

Administrator   Boarder
Posts: 16
From 01-May-2009
You're Points: 38
Bookmark
Re:How to pass the value when call exe in another app23 Feb 2010 01:02:50
Correct answer like followings Process process = new Process(); process.StartInfo.FileName = "notepad.exe"; process.StartInfo.Arguments = @"c:test.txt"; process.StartInfo.CreateNoWindow = false; process.StartInfo.WindowStyle = ProcessWindowStyle.Normal; process.Start(); Thank you Kirti Darji
Kirti.Darji.001
Expert  Boarder
Posts: 28
From 03-Jun-2009
You're Points: 538
Bookmark
Re:How to pass the value when call exe in another app23 Feb 2010 01:02:50
Hi, We can use the "Arguments" property in [b]ProcessStartInfo[/b] class for passing parameters to start a new application. Check the following, [code]System.Diagnostics.ProcessStartInfo processStart = new System.Diagnostics.ProcessStartInfo("myApp.exe"); processStart.Arguments = "aruguments"; Process.Start(processStart);[/code] We can change the main() method to accept the string[] arguments/parameters as follows, [code]static void Main(string[] args) { if (args.Length > 0) { Console.Write("args length: " + args.Length.ToString()); Console.Write("\n\n"); foreach (string singleArg in args) { Console.WriteLine(singleArg); } } else { Console.WriteLine("No args !"); } }[/code] Otherwise you can use the [b]Environment.GetCommandLineArgs();[/b] for returns a string[] array of arguments given to the application. [color=#800080][b]...S.VinothkumaR.[/b][/color] [url]http://vinothnat.blogspot.com[/url]
vinothnat
Junior  Boarder
Posts: 0
From 03-Jun-2009
You're Points: 36
Bookmark
^ Scroll to Top