2024年6月21日发(作者:)
ASP+Access微信平台接口开发示例
<%@Language="VBScript" CodePage="65001"%>
<%
dim ToUserName
dim FromUserName
dim textcontent
dim Content
dim MsgType
dim tmp
set
xml_ request
ToUserName=xml_mentsbytagname("ToUserNa
me").item(0).text
FromUserName=xml_mentsbytagname("FromUs
erName").item(0).text
Content=xml_mentsbytagname("Content").item(
0).text
MsgType=xml_mentsbytagname("MsgType").ite
m(0).text
if Content="0" then
textcontent="[艾布布_IP归属查询]" & vbcrlf & "IP格式为点分
十进制IPV4," & vbcrlf & "如:192.168.1.55"
else
if cacuIp(Content)="0" then
textcontent="无效IP,请重新回复,如需帮助请回复0"
else
textcontent=Content & "_" & address(Content)
xml_dom =
Object("ument")
end if
end if
call sendmsg(fromusername,tousername,textcontent)
sub sendmsg(fromusername,tousername,textcontent)
strresponse=""
strresponse
call writelog(textcontent & now,"",8)
end sub
sub writelog(contentlog,logname,ftype)
filepath=h(".")&"" & logname
Set fso = Object("stemObject")
set fopen=xtFile(filepath, clng(ftype) ,true)
ine(contentlog)
set fso=nothing
set fopen=Nothing
end sub
Function cacuIp(ip_address)
On Error Resume Next
Dim srIp, aIp
srIp=0
aIp = Split(ip_address,".")
If UBound(aIp)<>3 Then
cacuIP=0
Exit Function
End If
For i=0 To 3
srIp=srIp+(CInt(aIp(i))*(256^(3-i)))
Next
cacuIp=srIp-1
If Err Then cacuIp=0
End Function
function address(ip)
Set CONN=Object("tion")
iIp=cacuIp(ip)
SQL = "SELECT country,city FROM [cnzzz_com_IP] WHERE
ip1<=" & iIp & " AND ip2>=" & iIp
Set rsCnt = e (SQL)
If Then
address="[查无记录!]"
Else
address="[" & rsCnt(0) &"_"& rsCnt(1) & "]"
End If
Set rsCnt=Nothing
set CONN=nothing
end function
%>
"DRIVER={Microsoft Access Driver
(*.mdb)};DBQ="&h("ip_")
发布者:admin,转转请注明出处:http://www.yc00.com/news/1718917497a2753535.html
评论列表(0条)