<%@Language=
"VBScript"
CodePage=
"65001"
%>
<%
dim signature
dim timestamp
dim nonce
dim Token
dim signaturetmp
token=
"myweixincode"
signature = Request(
"signature"
)
nonce = Request(
"nonce"
)
timestamp = Request(
"timestamp"
)
dim ToUserName
dim FromUserName
dim CreateTime
dim MsgType
dim wxCont
dim MsgId
Sub
getMSG()
on error resume next
set xDom = Server.CreateObject(
"MSXML2.DOMDocument"
)
xDom.load request
ToUserName=xDom.getelementsbytagname(
"ToUserName"
).item(0).text
FromUserName=xDom.getelementsbytagname(
"FromUserName"
).item(0).text
MsgType=xDom.getelementsbytagname(
"MsgType"
).item(0).text
if MsgType=
"text"
then wxCont=xDom.getelementsbytagname(
"Content"
).item(0).text
if MsgType=
"event"
then wxCont=xDom.getelementsbytagname(
"Event"
).item(0).text
set xDom=
Nothing
End
sub
call getMSG()
if FromUserName=
""
and wxCont=
""
then response.end
wxCont=replace(wxCont,chr(13),
""
)
wxCont=replace(wxCont,chr(10),
""
)
wxCont=trim(wxCont)
function has(keys)
dim ss,i
keys=replace(keys,
";"
,
";"
)
ss=split(keys,
";"
)
for i=0 to ubound(ss)
if instr( lcase(wxCont),lcase( ss(i) ) )>0 then
has=true
exit function
end if
next
has=false
end function
if wxCont=
"subscribe"
then
reMSG=
"欢迎关注<吴世昌IT技术服务>"
&VBCrLf &
" 主页: "
&VBCrLf &
"www.fj543.com"
elseIf wxCont=
"unsubscribe"
Then
elseIf wxCont=
"0"
Then
reMSG=
"帮助说明:"
& VBCrLf &
"回复1查看我们的网址;回复2查看联系方式;"
elseif wxCont=
"1"
then
reMSG=
"我们的网址:"
&VBCrLf &
"www.fj543.com"
else
reMSG=
"感谢您的留言,吴世昌IT技术服务团队将尽快回复,请耐心等候。"
end if
reMSG=reMSG & vbcrlf& vbcrlf &
"回复数字0查看帮助说明."
outXML=
"<xml>"
&_
"<ToUserName><![CDATA["
&fromusername&
"]]></ToUserName>"
&_
"<FromUserName><![CDATA["
&tousername&
"]]></FromUserName>"
&_
"<CreateTime>"
& now() &
"</CreateTime>"
&_
"<MsgType><![CDATA[text]]></MsgType>"
&_
"<Content><![CDATA["
& reMSG &
"]]></Content>"
&_
"<FuncFlag>0<FuncFlag>"
&_
"</xml>"
response.write outXML
%>