I want to get the name of the currently running program, that is the executable name of the program. In C/C++ you get it from args[0]
.
相关问题
- 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
Try this:
This returns you a
System.Reflection.Assembly
instance that has all the data you could ever want to know about the current application. I think that theLocation
property might get what you are after specifically.System.Reflection.Assembly.GetEntryAssembly().Location
returns location of exe name if assembly is not loaded from memory.System.Reflection.Assembly.GetEntryAssembly().CodeBase
returns location as URL.