以文本方式查看主题 - Foxtable(狐表) (http://foxtable.com/bbs/index.asp) -- 专家坐堂 (http://foxtable.com/bbs/list.asp?boardid=2) ---- [求助] 发送移动短信 (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=150847) |
-- 作者:zcgmxf -- 发布时间:2020/6/9 9:49:00 -- [求助] 发送移动短信 老师,论坛有一个调用移动SDK发送短信的实例,现在好像和以前不一样了,能否帮忙看看。谢谢! |
-- 作者:有点蓝 -- 发布时间:2020/6/9 10:06:00 -- 测试不了,自己去看SDK的开发文档,看是哪里做了调整,相应自己改改 |
-- 作者:zcgmxf -- 发布时间:2020/6/10 8:21:00 -- 老师,这个是移动案例,用foxtable 怎么写代码,菜鸟学艺不精。谢谢! <!--[if !supportLists]-->1.1.1.1.1 <!--[endif]-->传输数据结构<!--[if !supportLists]-->l <!--[endif]-->接口地址:http://112.35.1.155:1992/sms/norsubmit <!--[if !supportLists]-->l <!--[endif]-->类型(TYPE):JSON <!--[if !supportLists]-->l <!--[endif]-->请求方式:post <!--[if !supportLists]-->l <!--[endif]-->数据编码格式:UTF-8 <!--[if !supportLists]-->l <!--[endif]-->传输数据加密方式:base64 <!--[if !supportLists]-->l <!--[endif]-->接口地址:http://112.35.1.155:1992/sms/norsubmit
{"addSerial":"","apId":"zrtsjh","content":"床前明月光,疑是地上霜。","ecName":"政企分公司测试","mac":"520525238bad246b31d99d77f0ae745a","mobiles":"13000000000","secretKey":"passwd@5056","sign":"DWItALe3A"} 将上述数据格式Base64加密(最终post提交的结果) eyJhZGRTZXJpYWwiOiIiLCJhcElkIjoienJ0c2poIiwiY29udGVudCI6IuW6iuWJjeaYjuaciOWFie+8jOeWkeaYr+WcsOS4iumcnOOAgiIsImVjTmFtZSI6IuaUv+S8geWIhuWFrOWPuOa1i+ivlSIsIm1hYyI6IjUyMDUyNTIzOGJhZDI0NmIzMWQ5OWQ3N2YwYWU3NDVhIiwibW9iaWxlcyI6IjEzMDAwMDAwMDAwIiwic2VjcmV0S2V5IjoicGFzc3dkQDUwNTYiLCJzaWduIjoiRFdJdEFMZTNBIn0= 字符集是UTF-8 |
-- 作者:有点蓝 -- 发布时间:2020/6/10 9:13:00 -- 大概这样 Dim hc As New HttpClient("112.35.1.155:1992/sms/norsubmit")\'hc.ContentType = "application/json" Dim jo As New JObject jo("addSerial") = "" jo("apId") = "zrtsjh" 其它自己补充,具体参考:http://www.foxtable.com/mobilehelp/topics/0167.htm Dim b As Byte() = System.Text.Encoding.UTF8.GetBytes(jo.ToString) Dim base64 = Convert.ToBase64String(b) Output.Show(base64 )hc.Content = base64
Dim ret As String = hc.GetData() MessageBox.Show(ret) [此贴子已经被作者于2020/6/10 9:14:07编辑过]
|
-- 作者:zcgmxf -- 发布时间:2020/6/10 10:04:00 -- 老师,论坛里有这个分享,是否可行?谢谢! [此贴子已经被作者于2020/6/10 10:28:08编辑过]
|
-- 作者:有点蓝 -- 发布时间:2020/6/10 10:13:00 -- 开发说明地址发上来看看 |
-- 作者:zcgmxf -- 发布时间:2020/6/10 10:35:00 -- 这是他们给的开发文档 [此贴子已经被作者于2020/6/10 10:41:53编辑过]
|
-- 作者:有点蓝 -- 发布时间:2020/6/10 10:45:00 -- 找接口方要.net的实例或者使用代码。里面有加密数据的算法 |
-- 作者:zcgmxf -- 发布时间:2020/6/10 11:43:00 -- 老师,他们说没有。net,可以使用http接口。没有案例 |
-- 作者:有点蓝 -- 发布时间:2020/6/10 13:43:00 -- 试试,如果不行,那就换个短信平台了,我也没辙 Dim hc As New HttpClient("112.35.1.155:1992/sms/norsubmit") Dim jo As New JObject jo("ecName") = "xxxx" jo("apId") = "zrtsjh" 其它值自己补充,具体参考:http://www.foxtable.com/mobilehelp/topics/0167.htm Dim str As String = jo("ecName").ToString & jo("apId").ToString & 其它加密值自己补充,根据文档按照顺序合并 Dim md5Hash As System.Security.Cryptography.MD5 = System.Security.Cryptography.MD5.Create() Dim data As Byte() = md5Hash.ComputeHash(Encoding.UTF8.GetBytes(str)) jo("mac") = Encoding.UTF8.GetString(data ) Dim base64 = Convert.ToBase64String(Encoding.UTF8.GetBytes(jo.ToString)) Output.Show(base64 ) hc.Content = base64 Dim ret As String = hc.GetData() MessageBox.Show(ret) |