c:inetpubwwwrootMyHost.exe Test.aspx > Test.htm 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.asx Code ----------------------------------------
<html> <body> Time is now: <%=Now%> </body> </html>
---------------------------------------- mk.bat Code ----------------------------------------
csc MyHost.cs /r:System.Web.dll |