微信开发者 对接 ASP代码

试了N种方法,还是不成功。本人的网站是ASP的,不想再用别的服务器了,所以想在自己的网站空间搞一个对接。始终失败,用尽了网上的所有方法。求哪位对接成功的给予帮助!

别听那些人不会的人瞎扯。

所谓接口, 就是任何语言都可以调用的。并不是只有PHP才能用。

我只能说某些人技术不够,或者懒得做而已。我的公众号就是用ASP做的接口。给你个简单的参考:

<%@Language="VBScript" CodePage="65001"%>
<%
'ASP文件以UTF-8的格式保存,否则可能乱码.
'====================================
'这两行代码是为了初期通过微信Token接口验证的.验证过后不再使用。
'response.write request("echostr")
'response.end
'====================================

dim signature '微信加密签名
dim timestamp '时间戳
dim nonce '随机数
'dim echostr '随机字符串
dim Token
dim signaturetmp
token="myweixincode" '您在后台添写的 token

signature = Request("signature")
nonce = Request("nonce")
timestamp = Request("timestamp")

dim ToUserName '开发者微信号
dim FromUserName'发送方帐号(一个OpenID)
dim CreateTime '消息创建时间(整型)
dim MsgType 'text
dim wxCont '消息内容
dim MsgId '消息id,64位整型

Sub getMSG()
on error resume next
'err.clear
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)
'on error resume next
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 '表示有新的用户关注,旧接口是Hello2BizUser
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查看帮助说明." ' & err.description

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
%>
温馨提示:答案为网友推荐,仅供参考
第1个回答  2014-07-23
你好,目前微信ASP没有接口,你可以使用PHP的追问

我的网站是ASP网站,不能使用PHP吧

追答

那没办法,微信开发只能PHP

第2个回答  2014-07-26
联系你了。
第3个回答  2014-07-23
联系你了。

-- 猴岛游戏论坛为您解答追问

看了,但是好像没有这个帖子哦。

相似回答