vb6.0做个查询快递单号小程序,网上抄的源码为什么过不了

vb6.0做个查询快递单号小程序,网上抄的源码为什么过不了,第1张

Function kdcx(kd, orderid)
Dim Err, url, kdtime, link, Errcode, Status, http, objDom, WebContent, Item
Select Case kd
Case "申通"
    kd = "shentong"
Case "圆通"
    kd = "yuantong"
Case "优速"
    kd = "yousu"
Case "龙邦"
    kd = "longbang"
Case "城市"
    kd = "cs"
Case Else
    kdcx = "暂时不支持此快递"
    Exit Function
End Select
Set http = CreateObject("MicrosoftXMLHTTP")
url = "http://wwwaikuaidicn/rest/key=29fe1030ceaa49ea8d0d7698efd1fd05&order=" & orderid & "&id=" & kd & "&ord=desc&show=xml"
httpOpen "get", url, False
httpsend
WebContent = httpresponsetext
Set http = Nothing
Set objDom = CreateObject("MicrosoftXMLDom")
objDomasync = False
objDomLoadXML WebContent
Set Item = objDomgetElementsByTagName("Root")
If ItemLength > 0 Then
    Select Case Item(0)getElementsByTagName("Status")(0)Text
    Case "-1"
        Status = "未更新的单号"
    Case "0"
        Status = "查询异常"
    Case "1"
        Status = "暂无记录"
    Case "2"
        Status = "在途中"
    Case "3"
        Status = "派送中"
    Case "4"
        Status = "已签收"
    Case "5"
        Status = "拒签收"
    Case "6"
        Status = "疑难件"
    Case "7"
        Status = "无效单"
    Case "8"
        Status = "超时单"
    Case "9"
        Status = "签收失败"
    Case Else
        Status = "快递状态未知情况"
    End Select
Else
    Status = "未知错误"
End If
Set Item = Nothing
Set objDom = Nothing
kdcx = Status
End Function

亲测无误,用法示例:

MsgBox kdcx("申通", "768911223344")

以上就是关于vb6.0做个查询快递单号小程序,网上抄的源码为什么过不了全部的内容,包括:vb6.0做个查询快递单号小程序,网上抄的源码为什么过不了、、等相关内容解答,如果想了解更多相关内容,可以关注我们,你们的支持是我们更新的动力!

欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/zz/9751848.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-05-01
下一篇 2023-05-01

发表评论

登录后才能评论

评论列表(0条)

保存