I have a .NET Console app (very simple). The entry point takes the infamous string[] args argument. Does this mean that from a command line, I could call this app and pass in a single string as a parameter? If so, how?
相关问题
- Sorting 3 numbers without branching [closed]
- Graphics.DrawImage() - Throws out of memory except
- Why am I getting UnauthorizedAccessException on th
- 求获取指定qq 资料的方法
- How to know full paths to DLL's from .csproj f
C:\application.exe string_parameter
Yes, the
string[] args
is from the command line. The zeroth element is the first argument and so on. Please note unlike C or C++,args[0]
doesn't contain the application name.So if you do:
Then:
If you pass only one argument, that is available as
args[0]
.