濮阳杆衣贸易有限公司

主頁 > 知識庫 > ASP 微信公共平臺接口實現(xiàn)代碼

ASP 微信公共平臺接口實現(xiàn)代碼

熱門標(biāo)簽:java外呼系統(tǒng)是什么 創(chuàng)意電話機器人 梧州市地圖標(biāo)注 地圖標(biāo)注陽江 外呼線路批發(fā) 世界地圖標(biāo)注了哪些城市 石家莊慧營銷外呼系統(tǒng) 武穴地圖標(biāo)注 濟源電銷外呼系統(tǒng)線路

復(fù)制代碼 代碼如下:

%@Language="VBScript" CodePage="65001"%>
%
'**********************************************
'注意事項
'ASP文件需要以UTF-8的格式保存,否則亂碼.
'以下兩行代碼是為了通過微信接口驗證的。
'response.write request("echostr")
'response.end
'**********************************************
dim signature        '微信加密簽名
dim timestamp        '時間戳
dim nonce                '隨機數(shù)
'dim echostr                '隨機字符串
dim Token
dim signaturetmp
token="ldwz"'您在后臺添寫的 token

signature = Request("signature")
nonce = Request("nonce")
timestamp = Request("timestamp")
'**********************************************
dim ToUserName        '開發(fā)者微信號
dim FromUserName'發(fā)送方帳號(一個OpenID)
dim CreateTime        '消息創(chuàng)建時間(整型)
dim MsgType                'text
dim Content                '文本消息內(nèi)容

set xml_dom = Server.CreateObject("MSXML2.DOMDocument")'此處根據(jù)您的實際服務(wù)器情況改寫
xml_dom.load request
FromUserName=xml_dom.getelementsbytagname("FromUserName").item(0).text '發(fā)送者微信賬號
ToUserName=xml_dom.getelementsbytagname("ToUserName").item(0).text '接收者微信賬號。即我們的公眾平臺賬號。
MsgType=xml_dom.getelementsbytagname("MsgType").item(0).text
if MsgType="text" then
Content=xml_dom.getelementsbytagname("Content").item(0).text
end if
'dim  mingling
'mingling=replace(content,chr(13),"")
'mingling=trim(replace(mingling,chr(10),""))
if (MsgType="event") then
        strEventType=xml_dom.getelementsbytagname("Event").item(0).text '微信事件
        if strEventType="subscribe" then '表示訂閱微信公眾平臺
                strsend=gz(FromUserName,ToUserName)
        ElseIf strEventType="unsubscribe" Then'取消關(guān)
                strsend=gz(FromUserName,ToUserName)
        end if
Else
'strsend=text(fromusername,tousername,Content)
strsend=""
end if
response.write strsend
set xml_dom=Nothing
'*************以下代碼只是為了調(diào)試作用***********
'filepath=server.mappath(".")"\wx.txt"
'Set fso = Server.CreateObject("Scripting.FileSystemObject")
'set fopen=fso.OpenTextFile(filepath, 8 ,true)
'fopen.writeline(strsend)
'set fso=nothing
'set fopen=Nothing
'****************調(diào)試結(jié)束************************

function gz(fromusername,tousername)
gz="xml>" _
"ToUserName>![CDATA["fromusername"]]>/ToUserName>" _
"FromUserName>![CDATA["tousername"]]>/FromUserName>" _
"CreateTime>"now"/CreateTime>" _
"MsgType>news/MsgType>" _
"ArticleCount>5/ArticleCount>" _
"Articles>" _
"item>" _
"Title>不賺差價的二手車交易市場/Title>" _
"Description>聊城二手車是二手車網(wǎng)上與實體相結(jié)合的二手車市場,以聊城二手車信息為主提供聊城及周邊地市的二手車交易信息,您可免費查看和發(fā)布二手車信息,辦理二手車相關(guān)業(yè)務(wù)。" _
"/Description>" _
"PicUrl>![CDATA[http://www.0635che.com/images/wxlogo.jpg]]>/PicUrl>" _
"Url>![CDATA[http://www.0635che.com/]]>/Url>" _
"/item>" _
"item>" _
"Title>![CDATA[查看二手車信息]]>/Title>" _
"Discription>![CDATA[全部二手車信息]]>/Discription>" _
"PicUrl>![CDATA[http://www.0635che.com/images/wxche.jpg]]>/PicUrl>" _
"Url>![CDATA[http://www.0635che.com/ershouche]]>/Url>" _
"/item>" _
"item>" _
"Title>![CDATA[二手車過戶手續(xù)]]>/Title>" _
"Discription>![CDATA[二手車過戶過戶手續(xù)]]>/Discription>" _
"PicUrl>![CDATA[http://www.0635che.com/images/wxgh.jpg]]>/PicUrl>" _
"Url>![CDATA[http://www.0635che.com/guohu]]>/Url>" _
"/item>" _
"item>" _
"Title>![CDATA[什么是不賺差價]]>/Title>" _
"Discription>![CDATA[電子商務(wù)]]>/Discription>" _
"PicUrl>![CDATA[http://www.0635che.com/images/wxxw.jpg]]>/PicUrl>" _
"Url>![CDATA[http://www.0635che.com/service]]>/Url>" _
"/item>" _
"item>" _
"Title>![CDATA[聯(lián)系我們]]>/Title>" _
"Discription>![CDATA[聯(lián)系我們]]>/Discription>" _
"PicUrl>![CDATA[http://www.0635che.com/images/wxlx.jpg]]>/PicUrl>" _
"Url>![CDATA[http://www.0635che.com/]]>/Url>" _
"/item>" _
"/Articles>" _
"FuncFlag>1/FuncFlag>" _
"/xml> "
end function

function text(fromusername,tousername,returnstr)
text="xml>" _
"ToUserName>![CDATA["fromusername"]]>/ToUserName>" _
"FromUserName>![CDATA["tousername"]]>/FromUserName>" _
"CreateTime>"now"/CreateTime>" _
"MsgType>![CDATA[text]]>/MsgType>" _
"Content>![CDATA[" returnstr "]]>/Content>" _
"FuncFlag>0FuncFlag>" _
"/xml>"
end function
%>

您可能感興趣的文章:
  • java微信開發(fā)API第一步 服務(wù)器接入
  • C#微信開發(fā)(服務(wù)器配置)
  • 微信JS接口匯總及使用詳解
  • PHP對接微信公眾平臺消息接口開發(fā)流程教程
  • 微信API接口大全
  • .net實現(xiàn)微信公眾賬號接口開發(fā)實例代碼
  • 微信公眾號支付(二)實現(xiàn)統(tǒng)一下單接口
  • c#使用微信接口開發(fā)微信門戶應(yīng)用
  • 微信公眾平臺開發(fā)接口PHP SDK完整版
  • 微信公眾平臺開發(fā)-微信服務(wù)器IP接口實例(含源碼)

標(biāo)簽:揭陽 甘南 來賓 滁州 淮北 迪慶 唐山 南寧

巨人網(wǎng)絡(luò)通訊聲明:本文標(biāo)題《ASP 微信公共平臺接口實現(xiàn)代碼》,本文關(guān)鍵詞  ASP,微信,公共,平臺,接口,;如發(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 微信公共平臺接口實現(xiàn)代碼》相關(guān)的同類信息!
  • 本頁收集關(guān)于ASP 微信公共平臺接口實現(xiàn)代碼的相關(guān)信息資訊供網(wǎng)民參考!
  • 推薦文章
    瓮安县| 南和县| 来宾市| 石屏县| 乐业县| 江陵县| 邵武市| 繁峙县| 通州区| 呈贡县| 尚义县| 青川县| 夏邑县| 三台县| 大安市| 穆棱市| 蓬莱市| 花莲市| 太湖县| 鱼台县| 丘北县| 搜索| 和林格尔县| 高要市| 韶关市| 那坡县| 修武县| 新丰县| 蓬莱市| 含山县| 凌海市| 河西区| 独山县| 常州市| 梧州市| 恩施市| 文登市| 平武县| 客服| 肥城市| 晋州市|