VB6怎样运行一个短信发布功能,采用HTTP方式

 我来答
福喜900
2015-02-10 · TA获得超过6.1万个赞
知道大有可为答主
回答量:1.1万
采纳率:0%
帮助的人:1亿
展开全部
 Function GetByWinHttp$(ByVal GetUrl$)
On Error Resume Next
Dim XmlHttp As Object
'Dim PicBytes() As Byte '验证码字节数组
Set XmlHttp = CreateObject("WinHttp.WinHttpRequest.5.1")
With XmlHttp
'.SetProxy 2, "IP:Port" '设置代理
If InStr(GetUrl, "&__K") <> 0 Then .Option(6) = False '禁止重定向
.Open "GET", GetUrl, True
.SetRequestHeader "Accept", "image/gif, image/jpeg, image/pjpeg, image/pjpeg, application/msword, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/x-ms-application, application/x-ms-xbap, application/vnd.ms-xpsdocument, application/xaml+xml, application/QVOD, application/QVOD, */*"
.SetRequestHeader "Accept-Language", "zh-cn"
.SetRequestHeader "User-Agent", "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 2.0.50727; .NET CLR 3.0.04506.648; .NET CLR 3.5.21022)"
'.SetRequestHeader "Accept-Encoding","gzip, deflate" 'gzip为压缩格式,一般可注释此行,如获取不到页面内容,或许就需要解压了.
'.SetRequestHeader "Host","bb" '一般可以省略。
.SetRequestHeader "Connection", "Keep-Alive"
.Send
.WaitForResponse
' PicBytes = .ResponseBody '下载后加载验证码
' Open App.Path & "\VerCode.jpg" For Binary As #1
' Put #1, , PicBytes
' Close #1
' frmMain.Picture1.Picture = LoadPicture(App.Path & "\VerCode.jpg")
' Kill App.Path & "\VerCode.jpg"
'========================================================'直接加载验证码[需加载ModLoadPngPic.Bas模块]
' Dim m_token As Long
' Dim StartupInput As GdiplusStartupInput
' StartupInput.GdiplusVersion = 1
' If GdiplusStartup(m_token, StartupInput, ByVal 0&) Then
' MsgBox "Error initializing GDI+"
' Exit Function
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式