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


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

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

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


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

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

 回到顶部
帅哥哟,离线,有人找我吗?
狐狸爸爸
  2楼 | 信息 | 搜索 | 邮箱 | 主页 | 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


 回到顶部
帅哥哟,离线,有人找我吗?
狐狸爸爸
  3楼 | 信息 | 搜索 | 邮箱 | 主页 | 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

 


 回到顶部
帅哥哟,离线,有人找我吗?
狐狸爸爸
  4楼 | 信息 | 搜索 | 邮箱 | 主页 | 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


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


加好友 发短信
等级:管理员 帖子:47497 积分:251403 威望:0 精华:91 注册:2008/6/17 17:14:00
  发帖心情 Post By:2013/6/25 17:02:00 [显示全部帖子]

1、donet是个类,你要调用其中这个类的某个方法或属性。

 

2、你要要用的话,还得实例化他:

 

Dim dn as New donet

某些代码

dn.方法1(参数1,参数2)

某些代码

dn.方法2(参数1,参数2)


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


加好友 发短信
等级:管理员 帖子:47497 积分:251403 威望:0 精华:91 注册:2008/6/17 17:14:00
  发帖心情 Post By:2013/6/25 17:43:00 [显示全部帖子]

用Messgebox.show或output.show显示一下合成的字符,看看是否不符合人家的规范。

如果你认为符合,但是还是不行,这个你就得问开发商了。

 

你想人家提问的时候,直接直接用合成好的字符串做例子,方便人家测试。


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


加好友 发短信
等级:管理员 帖子:47497 积分:251403 威望:0 精华:91 注册:2008/6/17 17:14:00
  发帖心情 Post By:2013/6/26 10:15:00 [显示全部帖子]

这个可以不用短信猫

 回到顶部