Windows Forms applications are great for creating simple user interfaces, but they can be a bit limiting when it comes to getting command line arguments. In this article, we’ll show you how to get command line arguments in a Windows Forms application. ..


Most of the examples you’ll find online will show you something like this:

That’s all fine and good, except that won’t work for our Windows Forms application without changing the type of the project to console, etc.

Thankfully, this is completely unnecessary, because you can simply do this:

And you can use this anywhere in your application, you aren’t just restricted to using it in the main() method like in a console application.