小弟有一个很急的问题:网页源代码 ( 积分: 100 )

  • 主题发起人 主题发起人 oboaixoaix
  • 开始时间 开始时间
O

oboaixoaix

Unregistered / Unconfirmed
GUEST, unregistred user!
网页中单击右键毫无反映,通过菜单无法查看网页源代码,另存为也保存不了,请问这是如何实现的(谁有 原代码,急),先谢过了。
 
网页中单击右键毫无反映,通过菜单无法查看网页源代码,另存为也保存不了,请问这是如何实现的(谁有 原代码,急),先谢过了。
 
你是要看你所打开的网页的源代码吗?如果是,用下面这条语句就可以了。
memo1.lines.add(ihtmldocument(webbrowser1.document).body.outerhtml);
 
memo1.lines.add(ihtmldocument(webbrowser1.document).body.outerhtml);

注意在uses那里引用 MSHTML 单元哦,否则上面的代码编译不了!
 
请把URL地址公布一下
 
捕获鼠标邮件单击事件
 
各位老大,我要查看源代码的网址是http://www.singbet3.com/,能否搬忙用你们提供的方法先测试一下,xd1972、coolfishs提供的方法不行啊。
 
怎么没人回复啊!
 
搜索下吧,我原来看到过相关解答,因为我也曾经做过
 
找不到啊,dfw001老兄,能否帮一下忙。
 
<script>if(self == top) location='http://www.singbet3.com'
;</script><html>
<head>
<meta http-equiv=&quot;Content-Type&quot;
content=&quot;text/html;
charset=big5&quot;>
<title>singbet2</title>
<link href=&quot;/style/member/mem_index.css&quot;
rel=&quot;stylesheet&quot;
type=&quot;text/css&quot;>
<script language=&quot;JavaScript&quot;>
<!--
function MM_swapImgRestore() { //v3.0
var i,x,a=document.MM_sr;
for(i=0;a&amp;&amp;i<a.length&amp;&amp;(x=a)&amp;&amp;x.oSrc;i++) x.src=x.oSrc;
}
function MM_preloadImages() { //v3.0
var d=document;
if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_preloadImages.arguments;
for(i=0;
i<a.length;
i++)
if (a.indexOf(&quot;#&quot;)!=0){ d.MM_p[j]=new Image;
d.MM_p[j++].src=a;}}
}
function MM_findObj(n, d) { //v4.0
var p,i,x;
if(!d) d=document;
if((p=n.indexOf(&quot;?&quot;))>0&amp;&amp;parent.frames.length) {
d=parent.frames[n.substring(p+1)].document;
n=n.substring(0,p);}
if(!(x=d[n])&amp;&amp;d.all) x=d.all[n];
for (i=0;!x&amp;&amp;i<d.forms.length;i++) x=d.forms[n];
for(i=0;!x&amp;&amp;d.layers&amp;&amp;i<d.layers.length;i++) x=MM_findObj(n,d.layers.document);
if(!x &amp;&amp;
document.getElementById) x=document.getElementById(n);
return x;
}
function MM_swapImage() { //v3.0
var i,j=0,x,a=MM_swapImage.arguments;
document.MM_sr=new Array;
for(i=0;i<(a.length-2);i+=3)
if ((x=MM_findObj(a))!=null){document.MM_sr[j++]=x;
if(!x.oSrc) x.oSrc=x.src;
x.src=a[i+2];}
}
//-->
</script>
</head>
<body bgcolor=&quot;#FFFFFF&quot;
background=&quot;/images/member/index_bg.jpg&quot;
text=&quot;#000000&quot;
leftmargin=&quot;0&quot;
topmargin=&quot;0&quot;
vlink=&quot;#000000&quot;
alink=&quot;#000000&quot;>
<div class=&quot;all&quot;>
<table width=&quot;100%&quot;
border=&quot;0&quot;
cellpadding=&quot;0&quot;
cellspacing=&quot;0&quot;>
<tr>
<td width=&quot;49%&quot;
class=&quot;lg&quot;>&amp;nbsp;</td>
<td width=&quot;2%&quot;>
<table width=&quot;772&quot;
border=&quot;0&quot;
cellspacing=&quot;0&quot;
cellpadding=&quot;0&quot;>
<tr>
<td width=&quot;433&quot;><img src=&quot;/images/member/index_ph11.jpg&quot;
width=&quot;433&quot;
height=&quot;46&quot;></td>
<td colspan=&quot;4&quot;
valign=&quot;bottom&quot;
background=&quot;/images/member/index_ph12.jpg&quot;>
<table width=&quot;250&quot;
border=&quot;0&quot;
cellspacing=&quot;0&quot;
cellpadding=&quot;0&quot;>
<tr>
<td><img src=/images/member/zh-tw/index_tw.gif></td>
<td><a href=http://www.singbet3.com/app/member/translate.php?set=zh-cn&amp;url=http://www.singbet3.com/app/member/index.php&amp;uid=28c11954 onMouseOut=MM_swapImgRestore() onMouseOver=MM_swapImage('Image2','','/images/member/zh-cn/index_cn2.gif',1)><img name=Image2 border=0 src=/images/member/zh-cn/index_cn.gif></a></td>
<td><a href=http://www.singbet3.com/app/member/translate.php?set=en-us&amp;url=http://www.singbet3.com/app/member/index.php&amp;uid=28c11954 onMouseOut=MM_swapImgRestore() onMouseOver=MM_swapImage('Image3','','/images/member/en-us/index_us2.gif',1)><img name=Image3 border=0 src=/images/member/en-us/index_us.gif></a></td>
<td><a href=http://www.singbet3.com/app/member/translate.php?set=th-tis&amp;url=http://www.singbet3.com/app/member/index.php&amp;uid=28c11954 onMouseOut=MM_swapImgRestore() onMouseOver=MM_swapImage('Image3','','/images/member/th-tis/index_tis.gif',1)><img name=Image3 border=0 src=/images/member/th-tis/index_tis.gif></a></td>
</tr>
</table>
</td>
</tr>
</table>
<table width=&quot;772&quot;
border=&quot;0&quot;
cellspacing=&quot;0&quot;
cellpadding=&quot;0&quot;>
<tr>
<td><object classid=&quot;clsid:D27CDB6E-AE6D-11cf-96B8-444553540000&quot;
codebase=&quot;http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0&quot;
width=&quot;772&quot;
height=&quot;140&quot;>
<param name=&quot;movie&quot;
value=&quot;../../../images/member/new.swf&quot;>
<param name=quality value=high>
<embed src=&quot;../../../images/member/new.swf&quot;
quality=high pluginspage=&quot;http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash&quot;
type=&quot;application/x-shockwave-flash&quot;
width=&quot;772&quot;
height=&quot;140&quot;></embed>
</object></td>
</tr>
</table>
<table width=&quot;772&quot;
height=&quot;37&quot;
border=&quot;0&quot;
cellpadding=&quot;0&quot;
cellspacing=&quot;0&quot;
background=&quot;../../../images/member/index_ph21.jpg&quot;>
<tr>
<td>&amp;nbsp;</td>
</tr>
</table>
<table width=&quot;772&quot;
border=&quot;0&quot;
cellspacing=&quot;0&quot;
cellpadding=&quot;0&quot;>
<tr>
<td><img src=&quot;/images/member/index_ph31.jpg&quot;
width=&quot;153&quot;
height=&quot;143&quot;></td>
<td><img src=&quot;/images/member/index_ph32.jpg&quot;
width=&quot;222&quot;
height=&quot;143&quot;></td>
<td><img src=&quot;/images/member/index_ph33.jpg&quot;
width=&quot;183&quot;
height=&quot;143&quot;></td>
<td><table width=&quot;100%&quot;
border=&quot;0&quot;
cellspacing=&quot;0&quot;
cellpadding=&quot;0&quot;>
<tr>
<td><img src=&quot;/images/member/index_log_top.gif&quot;
width=&quot;214&quot;
height=&quot;31&quot;></td>
</tr>
<tr>
<td height=&quot;83&quot;
background=&quot;/images/member/index_log_bg.gif&quot;><table width=&quot;85%&quot;
border=&quot;0&quot;
align=&quot;center&quot;
cellpadding=&quot;0&quot;
cellspacing=&quot;0&quot;>
<form name=&quot;LoginForm&quot;
action=&quot;./login.php&quot;
method=&quot;post&quot;>
<input type=HIDDEN name=&quot;uid&quot;
value=&quot;28c11954&quot;>
<input type=HIDDEN name=&quot;langx&quot;
value=&quot;zh-tw&quot;>
<tr>
<td width=&quot;25%&quot;>眀&amp;nbsp;
腹:</td>
<td><input type=&quot;text&quot;
name=&quot;username&quot;
size=&quot;16&quot;
class=&quot;za_text&quot;>
</td>
</tr>
<tr>
<td>盞&amp;nbsp;
絏:</td>
<td><input type=&quot;password&quot;
name=&quot;passwd&quot;
size=&quot;16&quot;
class=&quot;za_text&quot;>
</td>
</tr>
<tr>
<td>&amp;nbsp;</td>
<td><input type=&quot;submit&quot;
name=&quot;Submit2&quot;
value=&quot;絋﹚&quot;
class=&quot;za_button&quot;
>
</td>
</tr>
</form>
</table></td>
</tr>
<tr>
<td><img src=&quot;/images/member/index_log_down.gif&quot;
width=&quot;214&quot;
height=&quot;29&quot;></td>
</tr>
</table></td>
</tr>
</table>
<table width=&quot;772&quot;
border=&quot;0&quot;
cellpadding=&quot;0&quot;
cellspacing=&quot;0&quot;>
<tr>
<td width=&quot;153&quot;
height=&quot;49&quot;
align=&quot;center&quot;
background=&quot;../../../images/member/index_ph41.jpg&quot;><object classid=&quot;clsid:D27CDB6E-AE6D-11cf-96B8-444553540000&quot;
codebase=&quot;http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0&quot;
width=&quot;131&quot;
height=&quot;40&quot;>
<param name=movie value=&quot;../../../images/member/singbet.swf&quot;>
<param name=quality value=high>
<embed src=&quot;../../../images/member/singbet.swf&quot;
quality=high pluginspage=&quot;http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash&quot;
type=&quot;application/x-shockwave-flash&quot;
width=&quot;131&quot;
height=&quot;40&quot;>
</embed>
</object></td>
<td class=&quot;ser-&quot;><!--?狝盡絬:+628127058922 / +628127058923--> <br>
?舦┮Τ ?玜 ?某眤?IE5.0 800*600 ??蔼眒家Α聅凝セ?</td>
</tr>
</table>
</td>
<td width=&quot;49%&quot;
class=&quot;rg&quot;>&amp;nbsp;
</td>
</tr>
</table>
</div>
</body>
</html>
 
XF.Lian老兄,我想知道用程序如何实现,我要用程序去获取别人网页源代码。
 
procedure TForm1.Button4Click(Sender: TObject);
var
doc:IHTMLDocument2;
URL:String;
begin

URL:='http://www.lose-dschungel.de/verdienen/klick4lose.php';

WebBrowser1.Navigate(Trim(URL));


Memo1.Text :='';
do
c:= WebBrowser1.document as IHTMLDocument2;
Memo1.Text := String(doc.body.innerHTML) ;


end;
 
你没把地址弄对,它是一个框架结构。如果你直接获取http://www.singbet3.com的代码,你得到的是它的框架代码,你应该用框架里包含的页面地址。
 
后退
顶部