Foxtable(狐表)用户栏目专家坐堂 → [求助]这个api怎么写?空包api


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

主题:[求助]这个api怎么写?空包api

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


加好友 发短信
等级:六尾狐 帖子:1490 积分:10607 威望:0 精华:0 注册:2018/10/16 11:42:00
[求助]这个api怎么写?空包api  发帖心情 Post By:2019/11/7 10:39:00 [显示全部帖子]


[此贴子已经被作者于2020/3/19 23:10:45编辑过]

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


加好友 发短信
等级:六尾狐 帖子:1490 积分:10607 威望:0 精华:0 注册:2018/10/16 11:42:00
  发帖心情 Post By:2019/11/9 9:46:00 [显示全部帖子]

你这样写是不是有点复杂,我的好像比较简单点

Dim 时间 As Date = Date.Now
Dim 订单详情 As String="{""Platform"":""电子百世"",""SendContact"":""发件人"",""SendOfficePhone"":""15888888888"",""SendCellPhone"":""15888888888"",""SendState"":""广东省"",""SendCity"":""广州市"",""SendDistrict"":""番禺区"",""SendAddress"":""岭南大道321号"",""ProductTitle"":""物品类别如化妆品"",""Weight"":""2"",""Raddress"":[{""OrderNo"":""T100001111"",""Contact"":""收货人1"",""OfficePhone"":""15888888888"",""CellPhone"":""15888888888"",""State"":""广东省"",""City"":""广州市"",""District"":""番禺区"",""Address"":""岭南大道321号""}]}"
Dim 签名0 As String="13f4a636545c424eappKeyzto001logiTypebuykongbaoorders" & 订单详情 & "timestamp" & 时间 & "13f4a636545c424e"


Dim 被加密= 签名0
Dim 签名 = System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile(被加密 , "MD5")

Dim hc As new HttpClient("http://kongbao100.cn/OrderSubmit/index.asp")
hc.FormData.Add("appKey","zto001")
hc.FormData.Add("logiType","buykongbao")
hc.FormData.Add("orders",订单详情 )
hc.FormData.Add("timestamp", 时间 )
hc.FormData.Add("sign",签名 )
'Output.Show(hc.GetData)
'{"code":"0","msg":"下单成功","Data":[{"OrderNo":"T100001111","WaybillSn":"","Trackingno":"73120393412531"},{"OrderNo":"T100002","WaybillSn":"","Trackingno":"73120393412529"}]}
'{"code":"1010","msg":"对不起,该商品暂停出售","Data":""}

Dim jo As JObject = JObject.Parse(hc.GetData)
If jo("msg")="下单成功" Then

For Each jt As JToken In jo("Data")
    Output.Show("快递单号:" & jt("Trackingno").ToString )
Next

Else
output.Show("错误提醒:"jo("age"))
End If

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


加好友 发短信
等级:六尾狐 帖子:1490 积分:10607 威望:0 精华:0 注册:2018/10/16 11:42:00
  发帖心情 Post By:2019/11/9 9:49:00 [显示全部帖子]

MD5 16位小写这样获取 (里面不是动态的就直接写出MD5小写16的值了)
Dim str As String = "1233312"
Dim md5 As new System.Security.Cryptography.MD5CryptoServiceProvider()
Dim byData() As Byte = Encoding.Default.GetBytes(str)
Dim result() As Byte = md5.ComputeHash(byData)
Dim md5Str As String = BitConverter.ToString(result, 4, 8)
md5Str = md5Str.Replace("-", "").ToLower
Output.Show(md5Str)

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


加好友 发短信
等级:六尾狐 帖子:1490 积分:10607 威望:0 精华:0 注册:2018/10/16 11:42:00
  发帖心情 Post By:2019/11/9 13:11:00 [显示全部帖子]

哦,懂了,MD5你是做在全局代码里面,然后写JObject 然后在放进去

 回到顶部