計算出DWORD IP地址(範本)


Tek 發表



先給允一個IP(可以透過DOS的Ping指令得到IP),然後程式再幫您算出答案•

通常大家看到的ip都會是(假設HINET的)
http://www.hinet.net
或者是
http://168.95.1.88
但是,利用網址的IP算出DWORD IP地址應該不常看到吧?
http://2824798552/

不會的人可以直接用這個程式去算就可以囉•
請直接將以下程式碼複製會去成*.HTM即可,這是網頁•
用Visual Basic Script寫的...


<html>
<head>
<SCRIPT LANGUAGE="VBS">
sub con_onclick()
'Coded by Tek
'monkey reminded me this...
dim theip(3)
theip(0) = trim(dword.comb1.value)
theip(1) = trim(dword.comb2.value)
theip(2) = trim(dword.comb3.value)
theip(3) = trim(dword.comb4.value)
If isnumeric(theip(0))=false or isnumeric(theip(1))=false or isnumeric(theip(2))=false or isnumeric(theip(3))=false then
msgbox "錯誤的IP(不正確)",16,"錯誤"
elseif instr(theip(0)," ")>=1 or instr(theip(1)," ")>=1 or instr(theip(2)," ")>=1 or instr(theip(3)," ")>=1 then
msgbox "錯誤的IP(不正確)",16,"錯誤"
elseif len(theip(0)) > 3 or len(theip(1)) > 3 or len(theip(2)) > 3 or len(theip(3)) > 3 then
msgbox "錯誤的IP(不正確)",16,"錯誤"
else
dim res(3)
res(0) = cdbl(theip(0)) * 16777216
res(1) = cdbl(theip(1)) * 65536
res(2) = cdbl(theip(2)) * 256
res(3) = cdbl(theip(3)) * 1
dim answer
answer = res(0)+res(1)+res(2)+res(3)
dwordip.innertext = "計算的結果: HTTP:// " & answer
dim question
question = Msgbox("請問您要直接測試利用此IP瀏覽該網站嗎?",4,"問題")
if question = 6 then
window.open "HTTP://" & answer
else
alert("否認...")
exit sub
end if
end If
end sub
</SCRIPT>
<meta http-equiv="Content-Type" content="charset=big5">
</head>
<body>
<form method="POST" name="dword">
<h5><font color="#808080">請輸入您要算出的<span lang="en-us">IP:<br>
(DWORD IP </span>地址)</font></h5>
<p>
<input type="text" name="comb1" size="3" style="border: 1px groove #C0C0C0"><span lang="en-us">.</span><input type="text" name="comb2" size="3" style="border: 1px groove #C0C0C0"><span lang="en-us">.</span><input type="text" name="comb3" size="3" style="border: 1px groove #C0C0C0"><span lang="en-us">.</span><input type="text" name="comb4" size="3" style="border: 1px groove #C0C0C0"></p>
<p><input type="button" value="計算" name="con" style="border: 1px solid #C0C0C0"><span lang="en-us">
</span><input type="reset" value="重算" style="border: 1px solid #C0C0C0"></p>
</form>
<font id="dwordip"></font>
</body>
</html>

最後更新日期: 8/25/2002 1:29:20 PM