以文本方式查看主题

-  Foxtable(狐表)  (http://www.foxtable.com/bbs/index.asp)
--  专家坐堂  (http://www.foxtable.com/bbs/list.asp?boardid=2)
----  关于微信  (http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&id=120069)

--  作者:blackzhu
--  发布时间:2018/6/6 15:04:00
--  关于微信

Dim msg As new WeChat.MPSendText

msg.touser = "o_0W1wG4xCDJTpdqlTfjSdVjlznQ"

msg.text.content = "您好,这里是客服,请问有什么需要帮助的?"

Dim wechatServ As WeChat.WeChatPublicNo = WeChat.WeChatServer.Server("wx506f113977c3a8a3" )

Dim weRet = wechatServ.SendMsgController.SendMessage(msg.ToJson(True))

If weRet.Success Then

    msgbox("已发送")

Else

    msgbox("发送失败:" & weRet.ErrorMessage)

End If



这个例子 我换成我的公众号测试一下 怎么找不到对象,是不是还需要做什么设置?


--  作者:有点甜
--  发布时间:2018/6/6 15:35:00
--  

参考

 

http://wechat.foxtable.com:9009/WebHelp/scr/we0018.htm

 


--  作者:有点甜
--  发布时间:2018/6/6 15:38:00
--  

参考

 

http://wechat.foxtable.com:9009/WebHelp/scr/we0016.htm

 


--  作者:blackzhu
--  发布时间:2018/6/6 15:48:00
--  
这个我明白了,你贴出来的怎么和我的不一样的.你这个好像齐全嘛
--  作者:有点甜
--  发布时间:2018/6/6 15:56:00
--  

你初始化公众号了没有?如果提示空对象,说明你没有做

 

http://wechat.foxtable.com:9009/WebHelp/scr/we0016.htm

 

 


--  作者:blackzhu
--  发布时间:2018/6/6 16:02:00
--  
我发送信息成功了,但是对方回复的信息我怎么获取? 一定需要搭建web 服务?
[此贴子已经被作者于2018/6/6 16:02:48编辑过]

--  作者:有点甜
--  发布时间:2018/6/6 16:16:00
--  
以下是引用blackzhu在2018/6/6 16:02:00的发言:
我发送信息成功了,但是对方回复的信息我怎么获取? 一定需要搭建web 服务?
[此贴子已经被作者于2018/6/6 16:02:48编辑过]

 

对方回复的信息,发送到微信服务器,然后微信服务器转发给你的web服务器的。

 

必须搭建接收的web。


--  作者:blackzhu
--  发布时间:2018/6/6 16:26:00
--  

Select Case e.host

    Case "192.168.100.7","127.0.0.1","wechat.foxtable.com"

        Select Case e.Path

            Case "FoxTest"

                If e.Request.HttpMethod.ToUpper = "GET" \'get模式为验证回调接口

                    e.WriteString(e.Values("echostr"))

                ElseIf e.Request.HttpMethod.ToUpper = "POST"

                    Dim xml As String = e.PlainText

                    \'记录消息内容到日志

                    Output.Logs("AppLogging").Add(xml)

                    Output.Logs("AppLogging").Save(ProjectPath & "log.txt",True)

                    Output.Logs("AppLogging").Clear

                    \'回应公众号

                    e.WriteString("success"\'如果是服务号和订阅号

                    \'e.WriteString("") \'如果是企业号

                End If

    End Select

End Select



我按照这个方式测试下 获取不了信息 是什么原因? 用的是 127.0.0.1 端口80


--  作者:有点甜
--  发布时间:2018/6/6 16:28:00
--  

照着做

 

http://www.foxtable.com/mobilehelp/scr/0175.htm

 

如果本机测试,需要端口映射

 

http://www.nat123.com/

 

https://www.ngrok.cc/


--  作者:blackzhu
--  发布时间:2018/6/6 17:17:00
--  
Select Case e.path
    Case "wefox" 
        If e.Request.HttpMethod = "GET" Then
            Dim token = "foxtable" 
\'
必须和设置的Token相同
            Dim signature As String = e.GetValues("signature")
            Dim timestamp As String = e.GetValues("timestamp"
            Dim nonce As String = e.GetValues("nonce"
            Dim echostr As String = e.GetValues("echostr")
            Dim aryTmp() As String = {token,timestamp,nonce}
            Array.Sort(aryTmp)
            Dim strTmp As String = String.Join("", aryTmp)
            strTmp = Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile(strTmp, "SHA1")
            If signature = strTmp.ToLower() Then
                e.WriteString(echostr)
            
End If
        End 
If

End
 Select


按照这个的话 页面会显示什么