如何隐藏网页HTML代码?

HTML网页代码能不能被隐藏掉?怎么隐藏?谢谢各位了
---------------------------------------------------------------

inpossible
---------------------------------------------------------------

绝对不可能!
---------------------------------------------------------------

除非你不让人浏览
---------------------------------------------------------------

如果你仅仅是不让人用“查看源代码”看到代码,可以使用脚本做“推”式无刷新更新就可以了,这仅仅是欺负那些很菜的人。但是有个原理你要清楚:只要浏览器里可以看到的东西,必定可以看到代码,只要用VB写一个小工具就可以了。以前曾经有人在服务器上做文章,号称别人无法看到代码,但最后还是被我捕捉到了。假如你不想被别人捕捉到脚本,除非做ASP才能隐蔽程序的算法。
---------------------------------------------------------------

你将下面的这个代码用记事本存成Logon.vbs,然后双击这个vbs文件看看有什么现象。这就是我所说的“推”式更新。看看弹出来的网页有没有代码?呵呵!即使这样还是可以被捕捉到代码的。

Dim pubLogonURL

pubLogonURL="http://expert.csdn.net/member/logon.asp"

Dim pubWindow
Dim pubDocument

Dim pubTimeout

pubTimeout=15

Set pubWindow=CreateObject("InternetExplorer.Application")
pubWindow.Visible = True
pubWindow.Navigate "about:blank"

Set pubDocument=DocumentGetByWindows(pubWindow,pubTimeout)
Set tObj=LogonGetByCreate(pubDocument)
pubDocument.body.innerHTML=tObj.outerHTML

Function DocumentGetByWindows(pWindow,pTimerout)
tOnLoopTimer=Timer
Do
tTimeout=Abs(tOnLoopTimer-Timer)
Loop Until pWindow.ReadyState=4 Or tTimeout>pTimerout

Set DocumentGetByWindows=pWindow.document
End Function

Function LogonGetByCreate(pDocument)

With pDocument.body
.style.backgroundcolor="rgb(0,0,0)"
.style.color="rgb(255,255,255)"
.style.fontfamily="宋体"
.style.fontsize="9pt"
End With

Set tForm=pDocument.createElement("

 1<form name="alogon">")   
 2With tForm   
 3.method="POST"   
 4.target="_blank"   
 5.name="alogon"   
 6.action=pubLogonURL   
 7End With   
 8  
 9Set tP=pDocument.createElement("P")   
10tP.innerText="请输入ID:"   
11tForm.insertAdjacentElement "BeforeEnd",tP   
12  
13Set tInputName=pDocument.createElement("<input name="name"/>")   
14With tInputName   
15.type="text"   
16.name="name"   
17.size="7"   
18.height=22   
19.style.backgroundcolor="rgb(192,255,0)"   
20.style.color="rgb(0,0,0)"   
21.style.fontfamily="宋体"   
22.style.fontsize="9pt"   
23.style.borderleft="1px solid rgb(128,128,128)"   
24.style.borderright="1px solid rgb(255,255,255)"   
25.style.bordertop="1px solid rgb(128,128,128)"   
26.style.borderbottom="1px solid rgb(255,255,255)"   
27End With   
28tForm.insertAdjacentElement "BeforeEnd",tInputName   
29  
30Set tP=pDocument.createElement("P")   
31tP.innerText="请输入密码:"   
32tForm.insertAdjacentElement "BeforeEnd",tP   
33  
34Set tInputPass=pDocument.createElement("<input name="pass"/>")   
35With tInputPass   
36.type="password"   
37.name="pass"   
38.size="7"   
39.height=22   
40.style.backgroundcolor="rgb(192,255,0)"   
41.style.color="rgb(0,0,0)"   
42.style.fontfamily="宋体"   
43.style.fontsize="9pt"   
44.style.borderleft="1px solid rgb(128,128,128)"   
45.style.borderright="1px solid rgb(255,255,255)"   
46.style.bordertop="1px solid rgb(128,128,128)"   
47.style.borderbottom="1px solid rgb(255,255,255)"   
48End With   
49tForm.insertAdjacentElement "BeforeEnd",tInputPass   
50  
51Set tInputType=pDocument.createElement("<input name="type"/>")   
52With tInputType   
53.type="text"   
54.name="type"   
55.size="7"   
56.height=22   
57.value=1   
58.style.backgroundcolor="rgb(192,255,0)"   
59.style.color="rgb(0,0,0)"   
60.style.fontfamily="宋体"   
61.style.fontsize="9pt"   
62.style.borderleft="1px solid rgb(128,128,128)"   
63.style.borderright="1px solid rgb(255,255,255)"   
64.style.bordertop="1px solid rgb(128,128,128)"   
65.style.borderbottom="1px solid rgb(255,255,255)"   
66.style.visibility="hidden"   
67End With   
68tForm.insertAdjacentElement "BeforeEnd",tInputType   
69  
70Set tP=pDocument.createElement("P")   
71tP.innerText=""   
72tForm.insertAdjacentElement "BeforeEnd",tP   
73  
74Set tButtom=pDocument.createElement("INPUT")   
75With tButtom   
76.type="submit"   
77.value="进入"   
78.height=20   
79.style.backgroundcolor="rgb(100,150,200)"   
80.style.color="rgb(255,255,255)"   
81.style.fontfamily="宋体"   
82.style.fontsize="9pt"   
83.style.borderleft="2px solid rgb(255,255,255)"   
84.style.borderright="2px solid rgb(0,50,100)"   
85.style.bordertop="2px solid rgb(255,255,255)"   
86.style.borderbottom="2px solid rgb(0,50,100)"   
87End With   
88tForm.insertAdjacentElement "BeforeEnd",tButtom   
89  
90Set LogonGetByCreate=tForm   
91End Function   
92  
93\---------------------------------------------------------------   
94  
95加入javascript代码屏蔽右键!</form>
Published At
Categories with Web编程
Tagged with
comments powered by Disqus