Created
April 1, 2014 09:59
Revisions
-
nisar1 renamed this gist
Apr 1, 2014 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
nisar1 created this gist
Apr 1, 2014 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,51 @@ //argment in console application //1. first you need to use third party dll or code // NDesk.Options //2. second you can use it as using System; using NDesk.Options; namespace txtProcessorConsole { class Program { public static void Main(string[] args) { string smachine = ""; string sip = ""; int iport = 5005; int ipass = 0; string sxportPath = ""; var p = new OptionSet() { { "m|machine=", "the name of the {machine} ", (string v) => smachine = v }, { "i|ip=", "the address of the {ip} ", (string v) => sip = v }, { "p|port=", "the address of the {ip} ", (int v) => iport = v }, { "P|Pass=", "the address of the {ip} ", (int v) => ipass = v }, { "e|export=", "the address of the {ip} ", (string v) => sxportPath = v }, }; try { p.Parse(args); } catch (OptionException e) { Console.Write("greet: "); Console.WriteLine(e.Message); return; } Console.WriteLine(smachine + " " + sip + " " + iport + " " + ipass + " " + sxportPath); } } }