-
-
'ส่งคืนข้อมูล IP disp_ipaddressdata (ip, 0)
-
ฟังก์ชั่น look_ip (IP)
สลัว ...
'การตั้งค่าวัตถุคลาส
Set Station = ใหม่ tqqwry
'เริ่มค้นหาและส่งคืนผลการค้นหา
'คุณสามารถตรวจสอบได้ว่าที่อยู่ IP มีอยู่ในฐานข้อมูลตามค่าการส่งคืน QQWRY (IP) หรือไม่และสามารถดำเนินการอื่น ๆ ได้หากไม่มีการดำรงอยู่
'ตัวอย่างเช่นคุณสร้างฐานข้อมูลเป็นการตามล่าฉันจะไม่อธิบายรายละเอียดที่นี่
iptype = wry.qqwry (IP)
'ประเทศ: เขตข้อมูลระดับชาติและภูมิภาค
'Localstr: เขตข้อมูลจังหวัดและเทศบาลและอื่น ๆ
look_ip = wry.country & & wry.localstr
'' 'look_ip = wry.country &
ฟังก์ชันสิ้นสุด
-
'กลับไปที่ข้อมูล IP JS Call
-
ฟังก์ชั่น disp_ipaddressdata (ip, style)
Dimover, Iltype
Set Station = ใหม่ tqqwry
iptype = wry.qqwry (IP)
เลือกสไตล์เคส
กรณีที่ 1 disp_ipaddressdata = ip
กรณีที่ 2 disp_ipaddressdata = station.country
กรณีที่ 3 disp_ipaddressdata = wry.localstr
'กรณีอื่น disp_ipaddressdata = wry.country & & wry.localstr
กรณีอื่น disp_ipaddressdata = wry.country
สิ้นสุดเลือก
ฟังก์ชันสิ้นสุด
-
'กลับไปที่ข้อมูล qqwry
-
ฟังก์ชั่น wryinfo ()
dimover, iptype, qqwry_tem (0), qqwry_tem1 (1)
'การตั้งค่าวัตถุคลาส
Set Station = ใหม่ tqqwry
iptype = wry.qqwry (2555.255.255.254)
'อ่านข้อมูลเวอร์ชันฐานข้อมูล
qqwry_tem (0) = wry.country & & wry.localstr
'อ่านจำนวนที่อยู่ IP ฐานข้อมูล
qqwry_tem1 (1) = wry.recordcount + 1
wryinfo = qqwry_tem (0) & qqwry_tem1 (1)
ฟังก์ชันสิ้นสุด
คลาส tqqwry
-
'ชื่อเสียงของตัวแปร
-
Dim Country, Localstr, buf, ชดเชย
เริ่มต้นส่วนตัว endip, countryflag
QQWryFile สาธารณะ
Public FirstStartip, LastStartip, RecordCount
สตรีมส่วนตัว endipoff
-
'การเริ่มต้นโมดูลคลาส
-
คลาสย่อย class_initialize
ประเทศ =
localstr =
startip = 0
endip = 0
CountryFlag = 0
FirstStartip = 0
lastStartip = 0
endipoff = 0
qqwryfile = server.mappath (/data/qqwry.dat) 'QQ Innocent IP Inventory Path Path เพื่อเปลี่ยนเส้นทางของคุณ
สิ้นสุดย่อย
-
'ที่อยู่ IP แปลงเป็นจำนวนเต็ม
-
ฟังก์ชั่น iptoint (IP)
Dim Iparray, i
iparray = split (ip,., -1)
สำหรับ i = 0 ถึง 3
ถ้าไม่ใช่ isnumeric (iparray (i)) แล้ว iparray (i) = 0
ถ้า cint (iparray (i)) <0 thatn iparray (i) = abs (cint (iparray (i))))
ถ้า cint (iparray (i))> 255 นั้น iparray (i) = 255
ต่อไป
iptoint = (cint (iparray (0))*256*256*256) + (cint (iparray (1))*256*256) + (cint (iparray (2))*256) + cint (iparray (3) รักษา
ฟังก์ชันสิ้นสุด
-
'ที่อยู่ IP ของจำนวนเต็มของเรากลับด้าน
-
ฟังก์ชั่น inttoip (intvalue)
p4 = ค่า int -fix (intvalue/256)*256
intvalue = (intvalue-p4)/256
p3 = ค่า int -fix (intvalue/256)*256
intvalue = (intvalue-p3)/256
p2 = ค่า int -fix (intvalue/256)*256
intvalue = (intvalue -p2)/256
P1 = ค่า int
IntoIP = CSTR (P1) &
ฟังก์ชันสิ้นสุด
-
'รับตำแหน่ง IP เริ่มต้น
-
ฟังก์ชั่นส่วนตัว getStartip (recno)
Offset = FirstStartip + Recno * 7
stream.position = ชดเชย
buf = stream.read (7)
endipoff = ascb (midb (buf, 5, 1)) + (ascb (midb (buf, 6, 1))*256) + (ascb (midb (buf, 7, 1))*256*256)
startip = ascb (midb (buf, 1, 1)) + (ascb (midb (buf, 2, 1))*256) + (ASCB (MIDB (buf, 3, 1))*256*256) + (ASCB (MIDB (buf, 4, 1))*256*256*256)
getStartip = startip
ฟังก์ชันสิ้นสุด
-
'รับตำแหน่ง IP สิ้นสุด
-
ฟังก์ชั่นส่วนตัว geetedip ()
stream.position = endipoff
buf = stream.read (5)
endip = ascb (midb (buf, 1, 1)) + (ascb (midb (buf, 2, 1))*256) + (ASCB (MIDB (buf, 3, 1))*256*256) + (ASCB (MIDB (buf, 4, 1))*256*256*256)
CountryFlag = ASCB (MIDB (buf, 5, 1))
getEndip = endip
ฟังก์ชันสิ้นสุด
-
'รับข้อมูลระดับภูมิภาครวมถึงประเทศและจังหวัดและเมือง
-
ส่วนตัวย่อย GetCountry (IP)
ถ้า (CountryFlag = 1 หรือ CountryFlag = 2) จากนั้น
ประเทศ = getFlagstr (endipoff + 4)
ถ้า CountryFlag = 1 แล้ว
localstr = getFlagstr (Stream.position)
'ต่อไปนี้ใช้เพื่อรับข้อมูลเวอร์ชันฐานข้อมูล
ถ้า ip> = iPtoint (2555.255.255.0) และ IP <= iPtoint (255555.255.255) แล้ว
localstr = getFlagstr (endipoff + 21)
ประเทศ = getFlagstr (endipoff + 12)
สิ้นสุดถ้า
อื่น
localstr = getFlagstr (endipoff + 8)
สิ้นสุดถ้า
อื่น
ประเทศ = getFlagstr (endipoff + 4)
localstr = getFlagstr (Stream.position)
สิ้นสุดถ้า
'กรองข้อมูลที่ไร้ประโยชน์ในฐานข้อมูล
ประเทศ = ตัดแต่ง (ประเทศ)
localstr = trim (localstr)
ถ้า Instr (Country, CZ88.NET) แล้วประเทศ =
ถ้า instr (localstr, cz88.net) แล้ว localstr =
สิ้นสุดย่อย
-
'รับตัวระบุที่อยู่ IP
-
ฟังก์ชั่นส่วนตัว getFlagstr (ชดเชย)
ธงสลัว
ธง = 0
ทำทั้งหมด (จริง)
stream.position = ชดเชย
flag = ascb (stream.read (1))
if (flag = 1 หรือ flag = 2) จากนั้น
buf = stream.read (3)
ถ้า (ธง = 2) จากนั้น
CountryFlag = 2
endipoff = Offset -4
สิ้นสุดถ้า
Offset = ASCB (MIDB (BUF, 1, 1)) + (ASCB (MIDB (BUF, 2, 1))*256) + (ASCB (MIDB (BUF, 3, 1))*256*256)
อื่น
ออก
สิ้นสุดถ้า
วง
ถ้า (ชดเชย <12) จากนั้น
getFlagstr =
อื่น
stream.position = ชดเชย
getFlagstr = getStr ()
สิ้นสุดถ้า
ฟังก์ชันสิ้นสุด
-
'รับข้อมูลสตริง
-
ฟังก์ชั่นส่วนตัว getStr ()
สลัว C
getStr =
ทำทั้งหมด (จริง)
c = ascb (stream.read (1))
ถ้า (c = 0) จากนั้นออกจากทำ
'ถ้ามันเป็นสองไบต์ไบต์สูงจะรวมกันร่วมกับการสังเคราะห์ไบต์ต่ำของตัวละคร
ถ้า c> 127 แล้ว
ถ้า stream.eos ทางออกทำ
getStr = getStr & chr (ascw (chrb (ascb (stream.read (1))) & chrb (c)
อื่น
getStr = getStr & chr (c)
สิ้นสุดถ้า
วง
ฟังก์ชันสิ้นสุด
-
'ฟังก์ชั่นหลักดำเนินการค้นหา IP
-
ฟังก์ชั่นสาธารณะ qqwry (Dotip)
Dim IP, NRET
Dim Rangb, ช่วง, ช่วง, ช่วง
ip = iptoint (Dotip)
Set Stream = CreateObject (AdoDB.Stream)
stream.mode = 3
Stream.type = 1
stream.open
stream.loadfromfile qqwryfile
Stream.position = 0
buf = stream.read (8)
FirstStartip = ASCB (MIDB (BUF, 1, 1)) + (ASCB (MIDB (BUF, 2, 1))*256) + (ASCB (MIDB (BUF, 3, 1))*256*256) + (ASCB (MIDB (buf, 4, 1))*256*256*256)
lastStartip = ASCB (MIDB (buf, 5, 1)) + (ASCB (MIDB (buf, 6, 1))*256) + (ASCB (MIDB (BUF, 7, 1))*256*256) + (ASCB (MIDB (buf, 8, 1))*256*256*256)
recordCount = int
'ไม่พบที่อยู่ IP ใด ๆ ในฐานข้อมูล
ถ้า (recordCount <= 1) จากนั้น
ประเทศ = ไม่ทราบ
qqwry = 2
ฟังก์ชั่นออก
สิ้นสุดถ้า
rangb = 0
range = recordCount
ทำทำไม (rangb <(ช่วง -1))
rangb + range/2)
โทรหา getStartip (recno)
if (ip = startip) จากนั้น
rangb = recino
ออก
สิ้นสุดถ้า
if (ip> startip) จากนั้น
rangb = recino
อื่น
ช่วง = recno
สิ้นสุดถ้า
วง
โทรหา getStartip (rangb)
โทรหา getendip ()
if (startip <= ip) และ (endip> = ip) จากนั้น
'ไม่พบ
nret = 0
อื่น
' ปกติ
nret = 3
สิ้นสุดถ้า
โทรหา GetCountry (IP)
qqwry = nret
ฟังก์ชันสิ้นสุด
-
'ชั้นเรียนจบ
-
คลาสย่อย class_terminate
เมื่อเกิดข้อผิดพลาดต่อไป
สตรีม
ถ้า err แล้ว err.clear
ตั้งค่าสตรีม = ไม่มีอะไร
สิ้นสุดย่อย
ชั้นเรียนจบ
-