1.Cassini
http://cassinipp.codeplex.com/
http://blog.csdn.net/shanhe/article/details/176422
2.微型ASP.NET服务器
http://www.zxjeu.cn/down/netserver.rar
3.了解ApplicationHost.CreateApplicationHost自己编写,前两个方案都是基于此。
using System;using System.IO;
using System.Web;
using System.Web.Hosting;
public class MyExeHost : MarshalByRefObject
{
public void ProcessRequest(String page)
{
HttpRuntime.ProcessRequest(new SimpleWorkerRequest(page, null, Console.Out));
}
public static void Main(String[] arguments)
{
MyExeHost host = (MyExeHost)ApplicationHost.CreateApplicationHost(typeof(MyExeHost), "/foo", Environment.CurrentDirectory);
foreach (String page in arguments) {
host.ProcessRequest(page);
}
}
}
test.aspx
<html>
<body>
Time is now: <%=Now%>
</body>
</html>
成功后就可以用下面的方法执行MyHost.exe Test.aspx > Test.htmtest.htm就是test.aspx执行后的结果
MSDN:http://www.microsoft.com/china/MSDN/library/WebServices/WebServices/ServiceStation.mspx?mfr=true