好湿?好紧?好多水好爽自慰,久久久噜久噜久久综合,成人做爰A片免费看黄冈,机机对机机30分钟无遮挡

主頁 > 知識庫 > asp下IP地址分段計算函數(shù)

asp下IP地址分段計算函數(shù)

熱門標(biāo)簽:宿州防封外呼系統(tǒng)平臺 無營業(yè)執(zhí)照地圖標(biāo)注教學(xué) 高質(zhì)量的電銷外呼系統(tǒng) 地圖標(biāo)注還可以做嗎 硅基電話機器人加盟 外呼系統(tǒng)怎么話費 滴滴地圖標(biāo)注上車點 友邦互聯(lián)電銷機器人違法嗎 電銷機器人采購
IP地址分段計算
script language="JScript" Runat="Server">
function IPDeCode(EIP){
var Ip1,Ip2,Ip3,Ip4;
Ip1 = moveByteR(EIP  0xff000000,3);
Ip2 = moveByteR(EIP  0x00ff0000,2);
Ip3 = moveByteR(EIP  0x0000ff00,1);
Ip4 = EIP  0x000000ff;
return Ip1 + "." + Ip2 + "." + Ip3 + "." + Ip4;
}


function moveByteL(num,bytenum){
return num = (bytenum*8)
}

function moveByteR(num,bytenum){
return num >>>= (bytenum*8)
}

/script>


在vbs中沒有位操作,這樣在一個頁面中用到了js和vbs,并不好,如果用vbs也可以,不過羅嗦了一些,而且有一點注意,如果在vbs中split("202.102.29.6","."),會得到202,102,29三個數(shù),得不到最后一個6,所以需要將ip換成split("202.102.29.6"  ".",".")
我用vbs做的,由于沒有位操作,所以做得比較麻煩
%
function ip2int(ipstr)
dim iptemp,max
iptemp = split(ipstr".",".")
max = ubound(iptemp)
if max > 4 then
exit function
end if

dim a,b,i
a = "H"
for i = 0 to 3
b = Hex(iptemp(i))
if len(b) = 1 then
b = "0"b
end if
a = ab
next
ip2int = CLng(a)
end function

function int2ip(ip)
dim iptemp,a,ipstr,i,length
iptemp = Hex(ip)
length = 8 - len(iptemp)
for i = 1 to length
iptemp = "0"  iptemp
next
a = left(iptemp,2)
a = "H"  a
i = CInt(a)
a = CStr(i)
ipstr = a  "."
a = mid(iptemp,3,2)
a = "H"  a
i = CInt(a)
a = CStr(i)
ipstr = ipstr  a  "."
a = mid(iptemp,5,2)
a = "H"  a
i = CInt(a)
a = CStr(i)
ipstr = ipstr  a  "."
a = right(iptemp,2)
a = "H"  a
i = CInt(a)
a = CStr(i)
ipstr = ipstr  a
int2ip = ipstr
end function

dim testIP,testInt
testIP="202.102.29.6"
testInt = ip2int(testIP)
response.write testIP  " will be encoded to font color=red>"  testInt  "/font>br>"
response.write testIP  " will be dencoded to font color=red>"  int2ip(testInt)  "/font>br>"
%> 

 

標(biāo)簽:廣元 七臺河 宣城 錫林郭勒盟 江門 儋州 雅安 新余

巨人網(wǎng)絡(luò)通訊聲明:本文標(biāo)題《asp下IP地址分段計算函數(shù)》,本文關(guān)鍵詞  asp,下,地址,分段,計算,函數(shù),;如發(fā)現(xiàn)本文內(nèi)容存在版權(quán)問題,煩請?zhí)峁┫嚓P(guān)信息告之我們,我們將及時溝通與處理。本站內(nèi)容系統(tǒng)采集于網(wǎng)絡(luò),涉及言論、版權(quán)與本站無關(guān)。
  • 相關(guān)文章
  • 下面列出與本文章《asp下IP地址分段計算函數(shù)》相關(guān)的同類信息!
  • 本頁收集關(guān)于asp下IP地址分段計算函數(shù)的相關(guān)信息資訊供網(wǎng)民參考!
  • 推薦文章