Python allows the following: once I open cmd I can start python and then run python commands which return results directly in cmd. For example, I type print word
and cmd returns word
. Is there a similar thing for C# or the only way to execute C# code is to write it in a file and then compile it?
Use PowerShell.
This will allow you to access the objects in the .Net Framework as well the objects in the operating system.
Check this simple example:
Or you can check this advanced example:
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.