Advertisement
sanych_dv

Parsing arguments

Apr 27th, 2015
326
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.44 KB | None | 0 0
  1. // arguments:  
  2. // Base64Encode({"act" : "test"});
  3.  
  4.  static void Main(string[] args)
  5.         {
  6.             if (args.Length > 0) {
  7.              
  8.                Dictionary<string, string> argsDict = JsonConvert.DeserializeObject<Dictionary<string, string>>(Encoding.ASCII.GetString( Convert.FromBase64String(args[0]) ));
  9.  
  10.                argsDict.ToList().ForEach(x => Console.WriteLine(x.Key + " => " + x.Value));
  11.  
  12.  
  13.             }
  14.  
  15.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement