Node.cs是用C#实现的Node.js。
示例代码:
publicclassWebserver:INodeProgram{publicintMain(string[]args){newHttpServer((IHttpTransactiont)=>{Console.WriteLine("gotconnection{0}",t.Request.Path);t.Response.Write("<H1>HelloWorld!</H1>");t.Response.End();},IOLoop.Instance).Listen("10.0.2.15",8080);Console.WriteLine("listeningon8080");return0;}}
评论