Foxtable(狐表)用户栏目专家坐堂 → [求助]关于第三方短信平台二次开发的问题


  共有6976人关注过本帖树形打印复制链接

主题:[求助]关于第三方短信平台二次开发的问题

帅哥哟,离线,有人找我吗?
fjt4444
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:幼狐 帖子:118 积分:906 威望:0 精华:0 注册:2013/3/21 12:44:00
[求助]关于第三方短信平台二次开发的问题  发帖心情 Post By:2013/6/25 12:06:00 [只看该作者]

我用的第三方平台是“首易公司”的,他有C#的案例和JAVA的案例,也有VB的。以下是一个VB的事例:
 下载信息  [文件大小:   下载次数: ]
图片点击可在新窗口打开查看点击浏览该文件:vb.zip

经测试,填写正确企业ID和账号密码后能够发送短信。但是我不知道怎么将其应用到FoxTable中。我相信也有很多FoxTable的用户有这方面的需求(而帮助文档对于第三方短信平台的讲解不是很充分)。这是我的窗体设计:
 下载信息  [文件大小:   下载次数: ]
图片点击可在新窗口打开查看点击浏览该文件:短信发送问题.zip

我期望做到填写正确服务器和企业ID和账号密码后能够发送短信就行了。求助!谢谢。

 回到顶部
帅哥哟,离线,有人找我吗?
fjt4444
  2楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:幼狐 帖子:118 积分:906 威望:0 精华:0 注册:2013/3/21 12:44:00
  发帖心情 Post By:2013/6/25 13:45:00 [只看该作者]

如题。求助!沉了吗?

 回到顶部
帅哥哟,离线,有人找我吗?
狐狸爸爸
  3楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:管理员 帖子:47497 积分:251403 威望:0 精华:91 注册:2008/6/17 17:14:00
  发帖心情 Post By:2013/6/25 14:27:00 [只看该作者]

让对方直接提供vb.net或者c#的例子,这样就可以直接用foxtable中用了。

 回到顶部
帅哥哟,离线,有人找我吗?
fjt4444
  4楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:幼狐 帖子:118 积分:906 威望:0 精华:0 注册:2013/3/21 12:44:00
  发帖心情 Post By:2013/6/25 14:45:00 [只看该作者]

如下所示:
 下载信息  [文件大小:   下载次数: ]
图片点击可在新窗口打开查看点击浏览该文件:asp.net c#脚本.rar

 下载信息  [文件大小:   下载次数: ]
图片点击可在新窗口打开查看点击浏览该文件:asp.net vb脚本.rar


 回到顶部
帅哥哟,离线,有人找我吗?
狐狸爸爸
  5楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:管理员 帖子:47497 积分:251403 威望:0 精华:91 注册:2008/6/17 17:14:00
  发帖心情 Post By:2013/6/25 15:06:00 [只看该作者]

在foxtable中添加引用system.web.dll

 

将下面的代码复制到foxtable的全局代码

 

Public Class DotNet
    Public retValue As String = ""
    Dim WReq As System.Net.WebRequest
    Dim WResp As System.Net.WebResponse
    Dim sr As System.IO.StreamReader

    Public Function GetResponseA(ByVal corpID As String, ByVal loginName As String, ByVal send_No As String, ByVal words As String) As String
        '
        ' 创建将 URI 传递给 .Create() 方法的 WebRequest 对象
        ' 并通过调用 .GetResponse() 从服务器获取响应;
        ' 当涉及进展时,我们会仔细研究这样做的原因
        Dim _corpID As String = corpID
        Dim _LoginName As String = loginName
        Dim _send_no As String = send_No
        Dim _words As String = words
        'U
        Dim _YHURL As String = "http://web.mobset.com/SDK/Sms_Send.asp?CorpID=" & _corpID & "&LoginName=" & _LoginName & "&send_no=" & _send_no & "&msg=" & HttpUtility.UrlEncode(_words, System.Text.Encoding.GetEncoding("GB2312"))
        WReq = System.Net.WebRequest.Create(_YHURL)
        WResp = WReq.GetResponse()
        ''从服务器获取可读的流——将数据编写为 UTF7 码以写入到控制台
        sr = New System.IO.StreamReader(WResp.GetResponseStream(), System.Text.Encoding.UTF7)
        retValue = sr.ReadToEnd()
        sr.Close()
        Return retValue '返回值。。。
    End Function

    Public Sub GetReceive(ByVal corpID As String, ByVal loginName As String, ByRef sendNo() As String, ByRef recNum() As String, ByRef recTime() As String, ByRef content() As String)
        ' = "http://web.mobset.com/SDK/Sms_Status.asp?SmsID="&request("SmsID")
        Dim aDocument As New System.Xml.XmlDocument
        Dim _YHURL As String = "http://web.mobset.com/SDK/Sms_Recv.asp?CorpID=" & corpID & "&LoginName=" & loginName & "&XML=1"
        WReq = System.Net.WebRequest.Create(_YHURL)
        WResp = WReq.GetResponse()
        ''从服务器获取可读的流——将数据编写为 UTF7 码以写入到控制台
        sr = New System.IO.StreamReader(WResp.GetResponseStream(), System.Text.Encoding.UTF7)
        '返回剩余短信数量。。
        retValue = sr.ReadToEnd()
        sr.Close()
        aDocument.LoadXml(retValue)
        Dim ii, kk As Integer
        Dim iCount As Integer = -1
        For ii = 0 To aDocument.ChildNodes.Count - 1
            Dim xmlNode As System.Xml.XmlNode = aDocument.ChildNodes(ii)
            If xmlNode.NodeType = System.Xml.XmlNodeType.Element Then
                For kk = 0 To xmlNode.ChildNodes.Count - 1
                    Dim xmlNode2 As System.Xml.XmlNode = xmlNode.ChildNodes(kk)
                    If xmlNode2.ChildNodes.Count >= 4 Then
                        iCount += 1
                    End If
                Next
            End If
        Next
        ReDim sendNo(iCount)
        ReDim recNum(iCount)
        ReDim recTime(iCount)
        ReDim content(iCount)
        If iCount = -1 Then
            Exit Sub
        End If
        Dim jj As Integer = 0
        For ii = 0 To aDocument.ChildNodes.Count - 1
            Dim xmlNode As System.Xml.XmlNode = aDocument.ChildNodes(ii)
            If Not xmlNode Is Nothing Then
                If xmlNode.NodeType = System.Xml.XmlNodeType.Element Then
                    For kk = 0 To xmlNode.ChildNodes.Count - 1
                        Dim xmlNode2 As System.Xml.XmlNode = xmlNode.ChildNodes(kk)
                        If xmlNode2.ChildNodes.Count >= 3 Then
                            sendNo(jj) = xmlNode2.ChildNodes(0).ChildNodes(0).Value
                            recNum(jj) = CInt(Val(xmlNode2.ChildNodes(1).ChildNodes(0).Value))
                            recTime(jj) = xmlNode2.ChildNodes(2).ChildNodes(0).Value
                            ',1081471662,1081471663,1081471664,1081471665
                            content(jj) = System.Web.HttpUtility.UrlDecode(xmlNode2.ChildNodes(3).ChildNodes(0).Value)
                            jj += 1
                        End If
                    Next
                End If
            End If
        Next
    End Sub
    Public Sub GetStatus(ByVal msgID As String)
        Dim _YHURL As String = "http://web.mobset.com/SDK/Sms_Status.asp?SmsID=" & msgID
        WReq = System.Net.WebRequest.Create(_YHURL)
        WResp = WReq.GetResponse()
        ''从服务器获取可读的流——将数据编写为 UTF7 码以写入到控制台
        sr = New System.IO.StreamReader(WResp.GetResponseStream(), System.Text.Encoding.UTF7)
        retValue = sr.ReadToEnd()
        sr.Close()
    End Sub
    Public Sub GetLeftMsg(ByVal corpID As String, ByVal loginName As String)
        Dim _YHURL As String = "http://web.mobset.com/SDK/Sms_KYSms.asp?CorpID=" & corpID & "&LoginName=" & loginName
        WReq = System.Net.WebRequest.Create(_YHURL)
        WResp = WReq.GetResponse()
        ''从服务器获取可读的流——将数据编写为 UTF7 码以写入到控制台
        sr = New System.IO.StreamReader(WResp.GetResponseStream(), System.Text.Encoding.UTF7)
        '返回剩余短信数量。。
        retValue = sr.ReadToEnd()
        sr.Close()
    End Sub
End Class


 回到顶部
帅哥哟,离线,有人找我吗?
fjt4444
  6楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:幼狐 帖子:118 积分:906 威望:0 精华:0 注册:2013/3/21 12:44:00
  发帖心情 Post By:2013/6/25 15:42:00 [只看该作者]

那个"system.web.dll"就在“外部引用”那添加吗?我有点迷茫。我没有这个DLL文件的哇

 回到顶部
帅哥哟,离线,有人找我吗?
狐狸爸爸
  7楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:管理员 帖子:47497 积分:251403 威望:0 精华:91 注册:2008/6/17 17:14:00
  发帖心情 Post By:2013/6/25 15:48:00 [只看该作者]

.net 2.0自带,你直接输入文件名引用即可:

 

http://www.foxtable.com/help/topics/1936.htm

 


 回到顶部
帅哥哟,离线,有人找我吗?
fjt4444
  8楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:幼狐 帖子:118 积分:906 威望:0 精华:0 注册:2013/3/21 12:44:00
  发帖心情 Post By:2013/6/25 15:55:00 [只看该作者]

报错了:
图片点击可在新窗口打开查看此主题相关图片如下:qq图片20130625?,5348.jpg
图片点击可在新窗口打开查看

图片点击可在新窗口打开查看此主题相关图片如下:qq图片20130625?+5342.jpg
图片点击可在新窗口打开查看

图片点击可在新窗口打开查看此主题相关图片如下:qq图片20130625?;5324.jpg
图片点击可在新窗口打开查看

 回到顶部
帅哥哟,离线,有人找我吗?
狐狸爸爸
  9楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:管理员 帖子:47497 积分:251403 威望:0 精华:91 注册:2008/6/17 17:14:00
  发帖心情 Post By:2013/6/25 16:00:00 [只看该作者]

Public Class DotNet
    Public retValue As String = ""
    Dim WReq As System.Net.WebRequest
    Dim WResp As System.Net.WebResponse
    Dim sr As System.IO.StreamReader

    Public Function GetResponseA(ByVal corpID As String, ByVal loginName As String, ByVal send_No As String, ByVal words As String) As String
        '
        ' 创建将 URI 传递给 .Create() 方法的 WebRequest 对象
        ' 并通过调用 .GetResponse() 从服务器获取响应;
        ' 当涉及进展时,我们会仔细研究这样做的原因
        Dim _corpID As String = corpID
        Dim _LoginName As String = loginName
        Dim _send_no As String = send_No
        Dim _words As String = words
        'U
        Dim _YHURL As String = "http://web.mobset.com/SDK/Sms_Send.asp?CorpID=" & _corpID & "&LoginName=" & _LoginName & "&send_no=" & _send_no & "&msg=" & system.web.HttpUtility.UrlEncode(_words, System.Text.Encoding.GetEncoding("GB2312"))
        WReq = System.Net.WebRequest.Create(_YHURL)
        WResp = WReq.GetResponse()
        ''从服务器获取可读的流--将数据编写为 UTF7 码以写入到控制台
        sr = New System.IO.StreamReader(WResp.GetResponseStream(), System.Text.Encoding.UTF7)
        retValue = sr.ReadToEnd()
        sr.Close()
        Return retValue '返回值...
    End Function

    Public Sub GetReceive(ByVal corpID As String, ByVal loginName As String, ByRef sendNo() As String, ByRef recNum() As String, ByRef recTime() As String, ByRef content() As String)
        ' = "http://web.mobset.com/SDK/Sms_Status.asp?SmsID="&request("SmsID")
        Dim aDocument As New System.Xml.XmlDocument
        Dim _YHURL As String = "http://web.mobset.com/SDK/Sms_Recv.asp?CorpID=" & corpID & "&LoginName=" & loginName & "&XML=1"
        WReq = System.Net.WebRequest.Create(_YHURL)
        WResp = WReq.GetResponse()
        ''从服务器获取可读的流--将数据编写为 UTF7 码以写入到控制台
        sr = New System.IO.StreamReader(WResp.GetResponseStream(), System.Text.Encoding.UTF7)
        '返回剩余短信数量..
        retValue = sr.ReadToEnd()
        sr.Close()
        aDocument.LoadXml(retValue)
        Dim ii, kk As Integer
        Dim iCount As Integer = -1
        For ii = 0 To aDocument.ChildNodes.Count - 1
            Dim xmlNode As System.Xml.XmlNode = aDocument.ChildNodes(ii)
            If xmlNode.NodeType = System.Xml.XmlNodeType.Element Then
                For kk = 0 To xmlNode.ChildNodes.Count - 1
                    Dim xmlNode2 As System.Xml.XmlNode = xmlNode.ChildNodes(kk)
                    If xmlNode2.ChildNodes.Count >= 4 Then
                        iCount += 1
                    End If
                Next
            End If
        Next
        ReDim sendNo(iCount)
        ReDim recNum(iCount)
        ReDim recTime(iCount)
        ReDim content(iCount)
        If iCount = -1 Then
            Exit Sub
        End If
        Dim jj As Integer = 0
        For ii = 0 To aDocument.ChildNodes.Count - 1
            Dim xmlNode As System.Xml.XmlNode = aDocument.ChildNodes(ii)
            If Not xmlNode Is Nothing Then
                If xmlNode.NodeType = System.Xml.XmlNodeType.Element Then
                    For kk = 0 To xmlNode.ChildNodes.Count - 1
                        Dim xmlNode2 As System.Xml.XmlNode = xmlNode.ChildNodes(kk)
                        If xmlNode2.ChildNodes.Count >= 3 Then
                            sendNo(jj) = xmlNode2.ChildNodes(0).ChildNodes(0).Value
                            recNum(jj) = CInt(Val(xmlNode2.ChildNodes(1).ChildNodes(0).Value))
                            recTime(jj) = xmlNode2.ChildNodes(2).ChildNodes(0).Value
                            ',1081471662,1081471663,1081471664,1081471665
                            content(jj) = System.Web.HttpUtility.UrlDecode(xmlNode2.ChildNodes(3).ChildNodes(0).Value)
                            jj += 1
                        End If
                    Next
                End If
            End If
        Next
    End Sub
    Public Sub GetStatus(ByVal msgID As String)
        Dim _YHURL As String = "http://web.mobset.com/SDK/Sms_Status.asp?SmsID=" & msgID
        WReq = System.Net.WebRequest.Create(_YHURL)
        WResp = WReq.GetResponse()
        ''从服务器获取可读的流--将数据编写为 UTF7 码以写入到控制台
        sr = New System.IO.StreamReader(WResp.GetResponseStream(), System.Text.Encoding.UTF7)
        retValue = sr.ReadToEnd()
        sr.Close()
    End Sub
    Public Sub GetLeftMsg(ByVal corpID As String, ByVal loginName As String)
        Dim _YHURL As String = "http://web.mobset.com/SDK/Sms_KYSms.asp?CorpID=" & corpID & "&LoginName=" & loginName
        WReq = System.Net.WebRequest.Create(_YHURL)
        WResp = WReq.GetResponse()
        ''从服务器获取可读的流--将数据编写为 UTF7 码以写入到控制台
        sr = New System.IO.StreamReader(WResp.GetResponseStream(), System.Text.Encoding.UTF7)
        '返回剩余短信数量..
        retValue = sr.ReadToEnd()
        sr.Close()
    End Sub
End Class


 回到顶部
帅哥哟,离线,有人找我吗?
fjt4444
  10楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:幼狐 帖子:118 积分:906 威望:0 精华:0 注册:2013/3/21 12:44:00
  发帖心情 Post By:2013/6/25 16:07:00 [只看该作者]

thank you very much

 回到顶部
总数 18 1 2 下一页