{"id":367,"date":"2016-08-23T08:47:05","date_gmt":"2016-08-23T12:47:05","guid":{"rendered":"http:\/\/salzlechner.com\/dev\/?p=367"},"modified":"2016-08-23T12:41:57","modified_gmt":"2016-08-23T16:41:57","slug":"command-line-arguments-in-winforms-application","status":"publish","type":"post","link":"http:\/\/salzlechner.com\/dev\/2016\/08\/23\/command-line-arguments-in-winforms-application\/","title":{"rendered":"Command Line Arguments in WinForms Application"},"content":{"rendered":"<p>By default a WinForms application has a Main function without parameters<\/p>\n<p>To utilize command line arguments simply modify the implementation of your Main function in Program.cs<\/p>\n<pre class=\"lang:c# decode:true \">        static void Main(string[] args)\r\n        {\r\n            \/\/ command line args\r\n            \/\/\r\n\r\n            for (int iArg = 0; iArg &lt; args.Length; iArg++)\r\n            {\r\n                Console.WriteLine(\"args[{0}] == {1}\", iArg, args[iArg]);\r\n            }\r\n\r\n            ....\r\n\r\n        }<\/pre>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Simple example on how to process command line parameters in a WinForms app<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_et_pb_use_builder":"","_et_pb_old_content":"","_et_gb_content_width":"","ngg_post_thumbnail":0,"footnotes":""},"categories":[7,34],"tags":[],"class_list":["post-367","post","type-post","status-publish","format-standard","hentry","category-c","category-winforms"],"_links":{"self":[{"href":"http:\/\/salzlechner.com\/dev\/wp-json\/wp\/v2\/posts\/367","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/salzlechner.com\/dev\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/salzlechner.com\/dev\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/salzlechner.com\/dev\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/salzlechner.com\/dev\/wp-json\/wp\/v2\/comments?post=367"}],"version-history":[{"count":2,"href":"http:\/\/salzlechner.com\/dev\/wp-json\/wp\/v2\/posts\/367\/revisions"}],"predecessor-version":[{"id":372,"href":"http:\/\/salzlechner.com\/dev\/wp-json\/wp\/v2\/posts\/367\/revisions\/372"}],"wp:attachment":[{"href":"http:\/\/salzlechner.com\/dev\/wp-json\/wp\/v2\/media?parent=367"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/salzlechner.com\/dev\/wp-json\/wp\/v2\/categories?post=367"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/salzlechner.com\/dev\/wp-json\/wp\/v2\/tags?post=367"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}