Login
网站首页 > 文章中心 > VB6

VB获取网站跳转之后的网址源码分享

作者:小编 更新时间:2023-06-05 20:40:41 浏览量:104人看过

VB获取网站跳转之后的网址源码分享

软件介绍:Function YuZheGetTrueUrl(iYuZheUrl) ‘On Error Resume Next YuZheGetTrueUrl ...

Function YuZheGetTrueUrl(iYuZheUrl)

    'On Error Resume Next

    YuZheGetTrueUrl = ""

    Dim YuZheHttp

    Set YuZheHttp = CreateObject("WinHttp.WinHttpRequest.5.1")

    YuZheHttp.Option(6)=0 '禁止自动跳转

    YuZheHttp.SetTimeouts 5000, 5000, 30000, 5000 '设置超时

    YuZheHttp.Open "GET", iYuZheUrl, False

    YuZheHttp.Send

    If YuZheHttp.Status=302 Then '查找跳转页面

        YuZheGetTrueUrl = YuZheHttp.GetResponseHeader("Location")

    Else

        YuZheGetTrueUrl = iYuZheUrl

    End If

   Debug.Print YuZheHttp.responseText

    Set YuZheHttp=Nothing

End Function


版权声明:倡导尊重与保护知识产权,本站有部分资源、图片来源于网络,如有侵权,请联系我们修改或者删除处理。
转载请说明来源于"土嘎嘎" 本文地址:http://www.tugaga.com/jishu/vb/197.html
<<上一篇 2023-06-05
下一篇 >> 2023-06-05

相关推荐

编辑推荐

热门文章