用记事本打开网页的源文件 如何在WEBBROWSER中用,选择菜单中的源文件后,记事本弹出来读网页源文件 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 文本是 HtmlText := IHtmlDocument2(self.WebBrowser.Document).Body.OuterHtml ;procedure TMDIChild.ZZViewSourceCode;var hwndNotepad,hwndEdit : THandle; HtmlText : Widestring ;begin HtmlText := IHtmlDocument2(self.WebBrowser.Document).Body.OuterHtml ; WinExec('NOTEPAD.EXE',1); hwndNotepad := FindWindow('notepad',nil); hwndEdit := FindWindowEx(hwndNotepad, 0, 'Edit', nil); shellexecute(0,'open','notepad.exe',pchar(HtmlText),nil,sw_normal);end;这个只显示一个字符 取得完整源文件应该是 IHtmlDocument3(WebBrowser.Document).documentElement.outerHtml ;你可以把这个字符串内容存储到本地文本文件,然后调用notepad打开。即使如此,你可能发现这样子取出的内容与IE中“察看源文件”所得到的内容有些不同要真正模拟IE的功能,你可以使用IPersistFile(WebBrowser.Document).Save("D:\source.txt",false);然后调用notepad打开D:\source.txt 解释一下下列SQL语句 delphi 三层开发问题 怎么取这里的两个数据?? 怎样强制彻底结束一个应用程序? 大家好!我想提取字段的内容唯一值,应该怎样实现呢!谢谢 关于Tstringgrid控件 如何提高打开数据库的速度?(SQL2000,ADO方式) 读取INI文件的问题?用TIniFile类读取INI,能读取汉字吗? 如何根据外部程序按纽的句柄屏蔽其鼠标单击? Delphi将DLL集成在主程序中 请问如何用自己的弹出菜单屏蔽系统鼠标右键弹出菜单???/ 希望得到大家的帮助
HtmlText := IHtmlDocument2(self.WebBrowser.Document).Body.OuterHtml ;procedure TMDIChild.ZZViewSourceCode;
var
hwndNotepad,hwndEdit : THandle;
HtmlText : Widestring ;
begin
HtmlText := IHtmlDocument2(self.WebBrowser.Document).Body.OuterHtml ;
WinExec('NOTEPAD.EXE',1);
hwndNotepad := FindWindow('notepad',nil);
hwndEdit := FindWindowEx(hwndNotepad, 0, 'Edit', nil);
shellexecute(0,'open','notepad.exe',pchar(HtmlText),nil,sw_normal);
end;
这个只显示一个字符
IHtmlDocument3(WebBrowser.Document).documentElement.outerHtml ;
你可以把这个字符串内容存储到本地文本文件,然后调用notepad打开。即使如此,你可能发现这样子取出的内容与IE中“察看源文件”所得到的内容有些不同
要真正模拟IE的功能,你可以使用
IPersistFile(WebBrowser.Document).Save("D:\source.txt",false);
然后调用notepad打开D:\source.txt