.net 生成HTML页
protected override void OnPreInit(EventArgs e)
{
base.OnPreInit(e);
string path = Server.MapPath("HomePage.htm");
if (File.Exists(path))
{
DateTime lastUpdatedTime = File.GetLastWriteTime(path);
if ((DateTime.Now - lastUpdatedTime) <= TimeSpan.fromHours(2))
{
using (StreamReader reader = new StreamReader(path, Encoding.UTF8))
{
string basic = reader.ReadToEnd();
Response.Write(basic);
Response.End();
}
}
}
&nb
相关文档:
<select name="CluefromType" id="CluefromType" style="width: 182px" onchange="return CluefromOtherTypeSelected();">
<option value="市场走访">
市场走访
< ......
使用TWebBrowser组件保存网页为html和mht文件 收藏
一、保存为HTML文件
uses ActiveX;
...
procedure WB_SaveAs_HTML(WB : TWebBrowser; const FileName : string) ;
var
PersistStream: IPersistStreamInit;
Stream: IStream;
FileStream: TFileStream;
begin
if not Assigned(WB. ......
System.Net.WebClient wc = new System.Net.WebClient();
Byte[] pageData = wc.DownloadData("httP://www");
string s = System.Text.Encoding.Default.GetString(pageData); ......
双引号:"或"
单引号:'或'(IE实体名无效)
&符号:&或&
<小于:<或<
>大于:>或>
空格: 或 
£英磅:£或£
¥元:¥或¥
¦分隔符:¦或& ......
Dim objReg,objMatches,objMatch
Set objReg=new RegExp
objReg.Global=True
objReg.IgnoreCase=True
objReg.Pattern="<('[^']*'|""[^""]*""|[^'"">])*?>"
Set objMatches=objReg.Execute(字符串)
For Each objMatch In objMatches
找到的HTML :objMatch.value
Next
Set objMatches=Nothing
Set objRe ......