コード例 #1
0
ファイル: Pause.cs プロジェクト: digitalhermit/Jmaxxz.Console
 public int Run(Cli console,string[] args)
 {
     console.Out.Write(_waitText);
     console.In.Read();
     console.Out.WriteLine();
     return 0;
 }
コード例 #2
0
ファイル: Download.cs プロジェクト: jmaxxz/Jmaxxz.Console
 public int Run(Cli console,string[] args)
 {
     string source = null;
     string local  = null;
     Options opts = new Options("Downloads a specified file")
     {
         new Option((string s)=>source =s,"address","The source address of the file to be downloaded"),
         new Option((string l)=>local =l,"localFile","Save the remote file as this name"),
     };
     opts.Parse(args);
     if(source == null)
     {
         return 1;
     }
     using(var client = new System.Net.WebClient())
     {
         if(local !=null)
         {
             client.DownloadFile(new Uri(source),local);
         }
         else
         {
             var result = client.DownloadString(new Uri(source));
             console.Out.WriteLine(result);
         }
     }
     return 0;
 }
コード例 #3
0
ファイル: Sleep.cs プロジェクト: michaelgwelch/Jmaxxz.Console
 public int Run(Cli console,string[] args)
 {
     int time =0;
     Options opts = new Options("Waits for a period of time")
     {
         new Option((int t)=>time =t,"WaitTime","Time in milliseconds to sleep for")
     };
     opts.Parse(args);
     Thread.Sleep(time);
     return 0;
 }
コード例 #4
0
ファイル: Beep.cs プロジェクト: digitalhermit/Jmaxxz.Console
 public int Run(Cli console,string[] args)
 {
     Console.Beep();
     return 0;
 }
コード例 #5
0
ファイル: Echo.cs プロジェクト: digitalhermit/Jmaxxz.Console
 public int Run(Cli console,string[] args)
 {
     console.Out.WriteLine(string.Join(" ",args));
     return 0;
 }
コード例 #6
0
ファイル: Exit.cs プロジェクト: digitalhermit/Jmaxxz.Console
 public int Run(Cli console,string[] args)
 {
     _shell.Stop();
     return 0;
 }