Command Line Arguments in C# Applications in 10 Minutes or Less

preview_player
Показать описание
Sometimes, you want to launch your application with parameters that might change. For instance, when we launch docker, we tell it what image to load or what task to perform. C# applications can operate the same way.

In this 10-minute training episode, we will see how to accept command-line arguments in Console applications, including how to read multi-part arguments. We will also look at how to modify a WinForm application to take command-line arguments.

Рекомендации по теме
Комментарии
Автор

This is awesome! Now I can update my console app to winform and retain the right click functionality.

connormccarter
Автор

Command Line Arguments can also be added in the project's properties.

tetley
Автор

Hi Tim, thanks for the great "short" video. Is there a good open source library which you could recommend to use to parse/handle the command line options; I would like to avoid implementing this. Regards Christian

christianimfeld
Автор

Hey Tim I am doing your C# Mastercourse and I notice u are using top-level statements. Is it industry standard now?? Or you doing it because its less confusing for new ppl? I personally likes that each file looked the same and now main file feels weird.

pa
Автор

MS should have made the template include a code comment with something like "// Current scope is Main(string[] args)" when using top level statements.

AvgDan
Автор

Is this only in .net 8 or can you use command line args in winforms with .net framework 4.8?

dreddy
Автор

Tim, Quick question, what Extension are you using for the different coloured Braces ? Thanks

XDYL
Автор

Why do you have to do this ./ infront of the executable?

gower
Автор

Hello Tim, I have a question to ask :) I have subscribed to your tutorials but there are different videos in your YouTube channel. Before starting tutorials, I am a little bit confused. Do you have suggestions?

E_G_