© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•4y ago•
7 replies
ricardo

Main() and command-line arguments

When building console applications that take parameters, you can use the arguments passed to
Main(string[] args)
Main(string[] args)
.
What would be a simple way to do something like
example.exe --username=drpadawan --password=dontstealmypasswordplease
example.exe --username=drpadawan --password=dontstealmypasswordplease
.

I have looked at some nuget packages but I feel it must be possible without a third party package.
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

✅ Main program input arguments
C#CC# / help
17mo ago
❔ How can I get command-line activation arguments from a WinUI3 `AppActivationArguments`?
C#CC# / help
4y ago
How to create files before main and pass command line args with net8.0-browser and wasm
C#CC# / help
2y ago
✅ Running cmd line command via c# not working
C#CC# / help
2y ago