How to quickly code and run small C# code

后端 未结 19 1679
再見小時候
再見小時候 2021-01-31 01:46

There are times when I want to test new code from the forums or when I need to help my friends with specific C# problem. The problem is I don\'t want to create new \"project\" i

19条回答
  •  庸人自扰
    2021-01-31 01:47

    I use a batch file (csc.bat):
    C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\csc %1 %2 %3 %4 %5 %6 %7 %8 %9

    For vb.net I use this batch file(vbc.bat):
    C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\vbc %1 %2 %3 %4 %5 %6 %7 /r:system.windows.forms.dll /r:system.data.dll /r:system.dll

    For example: C:>csc testit.cs

    Each will create a .net .exe file. This solution is not so good for Windows Forms applications, however.

提交回复
热议问题