当前位置:编程学习 > C#/ASP.NET >>

使用NotePad++ 运行轻量级的C#代码

有时候想实验个C#代码中的小特性,不得不打开VisualStudio,但这实在是太重量级了,如果电脑性能一般的话,光打开VS就得等半天,这里我们可以使用notepad++来运行
在notepad++中新建文件hello.cs,F5运行,配置命令行
[plain]  
cmd /K C:\windows\Microsoft.NET\Framework\v4.0.30319\csc.exe /t:exe /out:$(FULL_CURRENT_PATH).exe $(FULL_CURRENT_PATH) && $(FULL_CURRENT_PATH).exe  
 
文件内容如下:
[csharp]  
using System;  
  
public class Program{  
    static void Main(){  
        Console.WriteLine("hello c#");  
    }  
}  
 
输出
[plain]  www.zzzyk.com
Microsoft(R) Visual C# 2010 编译器 4.0.30319.1 版  
版权所有(C) Microsoft Corporation。保留所有权利。  
  
hello c#  
 
补充:软件开发 , C# ,
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,