This is what ASP.NET does all the time. It searches for an ASPX page in the file system, compiles it if necessary, and then processes the request.
Codebehind is optional. You can have a site with only ASPX, without pre-compiled code.
ASPX codebehind
<%@ Page language="c#" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
<HEAD>
<title>ClearCache</title>
</HEAD>
<body>
<form id="ClearCache" method="post" runat="server">
<%
IList keys = new ArrayList(Cache.Count);
foreach (DictionaryEntry de in Cache)
keys.Add(de.Key);
foreach (string key in keys)
{
this.Response.Write(key + "<br>");
Cache.Remove(key);
}
%>
</form>
</body>
</HTML>
html:
var wc = new WebClient();
wc.DownloadFile(myUrl, filename);
- ASP.NET, . Cassini . :
var server = new Server(80,"/", pathToWebSite);
server.Start();
var wc = new WebClient();
wc.DownloadFile(server.RootUrl + "myPage.aspx", filename);
server.Stop();
, .
, RuntimeHost, 4. - . , .