精华内容
下载资源
问答
  • vb post

    2011-07-06 09:30:32
    好程序 不是源码
  • VBPOST代码示例

    热门讨论 2010-09-04 16:33:21
    VBPOST代码示例VBPOST代码示例VBPOST代码示例
  • vb post 登录网站

    热门讨论 2011-12-21 10:37:58
    vb post 登录 仅供学习测试使用,非商业软件
  • httppost提交数据VB.rar

    2019-12-14 22:44:25
    VB开发的通过httppost向服务器提交数据。Http协议Post提交。VB开发的通过httppost向服务器提交数据。Http协议Post提交
  • VB PostMessage操作计算器

    热门讨论 2010-11-06 17:36:32
    VB PostMessage操作计算器
  • VB POST数据

    千次阅读 2015-07-21 11:33:35
    INET:高效的获取网页源码控件,可以自己定义POST和GET方式,使用灵活,推荐使用 WSOCK:效率最高,但是所有东西都要自己定义 一、用Webbrowser 代码:Webbrowser.navigate (http://xxx/1.htm?name=apple&i

    WEBBROWSE:一般用在简单网页数据的获取,封装了COOKIES,使用方便,但是效率很低,因为要加载大量无用的LJ
    INET:高效的获取网页源码控件,可以自己定义POST和GET方式,使用灵活,推荐使用
    WSOCK:效率最高,但是所有东西都要自己定义

    一、用Webbrowser
    代码:Webbrowser.navigate (http://xxx/1.htm?name=apple&id=001)


    二、用Inet (注意数据接收方式是POST还是GET ,具体的方式是在1.htm的<form>...</form>中
    代码:(post方式)
    1、设定数据头:
    strSendHeader = "POST /hotbuy/myhotbuy.php HTTP/1.1" & vbCrLf
    strSendHeader = strSendHeader & "Content-Type: application/x-www-form-urlencoded " & vbCrLf
    strSendHeader = strSendHeader & "Content-Length: " & iSendLength & vbCrLf
    2、设定要发的数据:
    strsenddata= "name=apple&id=001"
    3、发送地址:
    strsendadd="http://xxx/1.htm
    3、发送数据:
    Inet.execute strsendadd,"POST",strsenddata,strsendHead
    Inet (Get方式) GET方式比POST简单的多
    代码:
    strsenddata = "http://xxx/1.htm?apple&id=001"
    Inet.execute strsenddata,"GET"


    三、用winsock
    1、设定数据头:
    strSendHeader = "POST /hotbuy/myhotbuy.php HTTP/1.1" & vbCrLf
    strSendHeader = strSendHeader & "Content-Type: application/x-www-form-urlencoded " & vbCrLf
    strSendHeader = strSendHeader & "Content-Length: " & iSendLength & vbCrLf
    2、设定要发的数据:
    strsenddata= "name=apple&id=001"
    strSend = strSendHeader & vbCrLf & strSendData
    3、发送地址:
    strsendadd="http://xxx/1.htm
    4、建立连接
    Winsock.RemoteHost = "http:/xxx/"
    Winsock.RemotePort = 80
    Winsock.Protocol = sckTCPProtocol
    winsock.connect
    Winsock1.SendData strsend
    Winsock.close

    VB Post方式提取网页数据

    Public Function getDataAsHtml(ByVal url As String, ByVal postData As String, ByVal modifyCook As Boolean)
            '构造请求头
            Try
                Dim httpUrl As New System.Uri(url) '生成URL类
                Dim req As HttpWebRequest '创建HTTP请求实例
                req = CType(WebRequest.Create(httpUrl), HttpWebRequest)
                req.CookieContainer = currentCookies
                req.Timeout = 600000

                '构造POST数据
                req.Method = "POST" '设置请求方式
                req.ContentType = "application/x-www-form-urlencoded"
                Dim ParameterEncoding As Encoding = System.Text.Encoding.GetEncoding("GB2312") '设置编码方式
                Dim bytesData As Byte() = ParameterEncoding.GetBytes(postData) '获取POST数据
                req.ContentLength = bytesData.Length '获取数据长度
                req.UserAgent = "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; Maxthon; SV1; .NET CLR 1.1.4322)"
                req.Accept = "*.*"
                req.ProtocolVersion = HttpVersion.Version11


                '发送HTTP请求
                Dim postStream As Stream = req.GetRequestStream()
                postStream.Write(bytesData, 0, bytesData.Length)   '以上向服务器post信息。
                postStream.Close()

                '读取返回信息

                Dim res As HttpWebResponse = CType(req.GetResponse(), HttpWebResponse) '以下获取服务器返回信息
                Dim reader As StreamReader = _
                New StreamReader(res.GetResponseStream, System.Text.Encoding.GetEncoding("GB2312"))
                currentHTML = reader.ReadToEnd()

                '测试返回信息
                'MsgBox(currentHTML)
                If modifyCook = True Then
                    Dim cook As Cookie
                    For Each cook In res.Cookies
                        currentCookies.Add(cook)
                        If cook.Name = "JSESSIONID" Then
                            sessionID = cook.Value.Substring(4, 23)
                        End If
                        If cook.Name = "EBankNetBank2001" Then
                            usera = cook.Value
                        End If
                    Next cook
                End If

                '关闭
                res.Close()
                Return currentHTML
            Catch ex As Exception
                MsgBox(ex.Message)
            End Try
        End Function

    参数说明,url---网址,postData---所要执行的动作及参数,modifyCook---是否改变本地的cookies。

    获取Cookie信息

    使用webbrowser获取某一个页面上的cookies信息。方法有两个。这里我们来获取百度页面上的cookies信息。
    Private Sub Command1_Click()
    MsgBox WebBrowser1.Document.cookie '用webbrowser的document对象获取
    End Sub

    Private Sub Command2_Click()
    WebBrowser1.Navigate "javascript:alert(document.cookie)"   '利用执行脚本获取
    End Sub

    Private Sub Form_Load()
    WebBrowser1.Navigate "http://www.baidu.com"

    End Sub

    展开全文
  • VB Post登陆网页Web QQ

    2013-02-01 10:47:44
    VB Post登陆网页Web QQ
  • vb6 http post

    2017-08-31 16:41:00
    Private Sub Form_Load...Dim postData As String Dim url As String url = "http://blog.csdn.net/haha4799/article/details/50837123#" postData = TextContent.Text '--- post Dim HttpClient As Object Set Ht...

    Private Sub Form_Load()
    Dim postData As String
    Dim url As String

    url = "http://blog.csdn.net/haha4799/article/details/50837123#"
    postData = TextContent.Text
    
    '--- post
    Dim HttpClient As Object
    
    Set HttpClient = CreateObject("Microsoft.XMLHTTP")
    HttpClient.Open "POST", url, False
    HttpClient.setRequestHeader "Content-Type", "text/xml; charset=UTF-8"
    HttpClient.Send pvToByteArray(postData)
    
    Do While HttpClient.readyState <> 4
        DoEvents
    Loop
    
    TextResponse.Text = HttpClient.responseText
    MsgBox "·ggg"

    End Sub

    Private Function pvToByteArray(sText As String) As Byte()
    pvToByteArray = GB2312ToUTF8(sText)
    End Function

    Public Function GB2312ToUTF8(strIn As String, Optional ByVal ReturnValueType As VbVarType = vbString) As Variant
    Dim adoStream As Object
    Set adoStream = CreateObject("ADODB.Stream")
    adoStream.Charset = "utf-8"
    adoStream.Type = 2 'adTypeText
    adoStream.Open
    adoStream.WriteText strIn
    adoStream.Position = 0
    adoStream.Type = 1 'adTypeBinary
    GB2312ToUTF8 = adoStream.Read()
    adoStream.Close

    If ReturnValueType = vbString Then GB2312ToUTF8 = Mid(GB2312ToUTF8, 1)
       

    End Function

    转载于:https://www.cnblogs.com/wgscd/articles/7459063.html

    展开全文
  • VB的HttpPost请求

    千次阅读 2019-05-23 20:21:13
    注意:URL最后要“/”结尾,否则会导致格式不正确无法正常接收。我就在这里踩过坑,不加“/”服务端就是收不到POST数据,后面才发现加了“/”就可以收到了。...下面是VB6的HTTP POST 发送数据的代码: '函数返回值是...

    注意:URL最后要“/”结尾,否则会导致格式不正确无法正常接收。我就在这里踩过坑,不加“/”服务端就是收不到POST数据,后面才发现加了“/”就可以收到了。

    函数使用示列:
    HttpPost(“http://172.20.11.114/KormeeDbHicky/devpsot/","data1=88&data2=99”)

    下面是VB6的HTTP POST 发送数据的代码:

    '函数返回值是返回信息
    'Url:发送的Url地址
    'PostMsg:要发送的数据
    
    Function HttpPost(Url As String, PostMsg As String) As String
    On Error GoTo er
    Dim XMLHTTP As Object
    Set XMLHTTP = CreateObject("Msxml2.XMLHTTP")
    If Not IsObject(XMLHTTP) Then
        Set XMLHTTP = CreateObject("Microsoft.XMLHTTP")
        If Not IsObject(XMLHTTP) Then Exit Function
    End If
    XMLHTTP.Open "POST", Url, False
    XMLHTTP.setRequestHeader "CONTENT-TYPE", "application/x-www-form-urlencoded"
    'XMLHTTP.send PostMsg
    XMLHTTP.send UTF8EncodeURI(PostMsg)
    
    Do While XMLHTTP.ReadyState <> 4
        DoEvents
    Loop
    
    If XMLHTTP.Status = 200 Then
        HttpPost = XMLHTTP.ResponseText
    Else
        HttpPost = ""
    End If
    
    Exit Function
    er:
        MsgBox "发送POST请求失败!", , "提示"
    End Function
    
    '发送的内容转为utf8
    Public Function UTF8EncodeURI(szInput)
    Dim wch, uch, szRet
    Dim X
    Dim nAsc, nAsc2, nAsc3
    
    If szInput = "" Then
        UTF8EncodeURI = szInput
        Exit Function
    End If
    
    For X = 1 To Len(szInput)
        wch = Mid(szInput, X, 1)
        nAsc = AscW(wch)
        If nAsc < 0 Then nAsc = nAsc + 65536
        If (nAsc And &HFF80) = 0 Then
            szRet = szRet & wch
        Else
            If (nAsc And &HF000) = 0 Then
                uch = "%" & Hex(((nAsc \ 2 ^ 6)) Or &HC0) & Hex(nAsc And &H3F Or &H80)
                szRet = szRet & uch
            Else
                uch = "%" & Hex((nAsc \ 2 ^ 12) Or &HE0) & "%" & _
                Hex((nAsc \ 2 ^ 6) And &H3F Or &H80) & "%" & _
                Hex(nAsc And &H3F Or &H80)
                szRet = szRet & uch
            End If
        End If
    Next
    
    UTF8EncodeURI = szRet
        
    End Function
    

    扫码下方二维码关注本人公众号分享编程相关知识,共同进步吧。

    工众号回复【我要资源免费获取,获取更多学习资源及视频教程 (Linux\Python\Java\PHP\Labview和大数据等视频资料)。

    联系邮箱:898109004@qq.com

    在这里插入图片描述

    微 信 号:yang10242019


    展开全文
  • VB6 post图片

    2018-02-13 15:55:00
    (tmpbuf, vbUnicode) End FunctionPrivate Sub PostFile( ByVal PUrl As String , ByVal PFile As String ) Dim PostData, Boundary As String Dim Upload_File As String Dim Http As ...

    在VBA中怎样用XMLhttp 模拟http上传二进制文件?

    https://www.zhihu.com/question/40974557

    作者:付杨
    链接:https://www.zhihu.com/question/40974557/answer/145193012
    来源:知乎
    著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。
    Private Function ToHexString(ByRef buf() As Byte) As String
        Dim i As Long, j As Long
        Dim nlen As Long
        Dim tmpHex As String
        Dim HexStr As String
        Dim tmpbuf() As Byte
        nlen = (UBound(buf) + 1) * 2
        ReDim tmpbuf(nlen - 1)
        j = 0
        For i = 0 To UBound(buf)
            HexStr = Hex(buf(i))
            If Len(HexStr) = 1 Then HexStr = "0" & HexStr
            tmpbuf(j) = Asc(Mid(HexStr, 1, 1))
            j = j + 1
            tmpbuf(j) = Asc(Mid(HexStr, 2, 1))
            j = j + 1
        Next
        ToHexString = StrConv(tmpbuf, vbUnicode)
    End FunctionPrivate Sub PostFile(ByVal PUrl As String, ByVal PFile As String)
    Dim PostData, Boundary As String
    Dim Upload_File  As String
    Dim Http As Object
    Dim fn As Integer
    Dim fbuf() As Byte
    Upload_File = PFile
    '------------------打开Adodb.stream 流读取二进制文件------------------
    fn = FreeFile()
    ReDim fbuf(FileLen(Upload_File) - 1)
    Open Upload_File For Binary As #fn
    Get #fn, , fbuf
    Close #fn
    '-----------------构造POST数据 ----------------------
    Boundary = "----WebKitFormBoundary1iVXNONaGEDOCghI"
    PostData = "--" & Boundary & vbCrLf
    PostData = PostData & "Content-Disposition: form-data; name=file; filename=F:\Work\E盘\mydata\VBSource\FrontClient2012 For SQL SERVER\20170208000018010000.jpg; payje=4.9; paytype=; payxsdbh=20170208000018010000; payxssj=15:53:40; payfdbh=0000;" & vbCrLf
    PostData = PostData & "Content-Type: application/x-jpg" & vbCrLf
    PostData = PostData & "" & vbCrLf
    PostData = PostData & ToHexString(fbuf) & vbCrLf     '写入文件二进制内容PostData = PostData & "--" & Boundary & vbCrLf'---------------发送数据包-------------------------------------
    Set Http = CreateObject("Msxml2.XMLHTTP")
    Http.Open "POST", PUrl, True
    Http.setRequestHeader "Content-Type", "multipart/form-data; boundary=" & Boundary
    Http.send PostData
    End Sub
    
    

     

     

    转载于:https://www.cnblogs.com/dlsunf/p/8446803.html

    展开全文
  • <p>VB.NET WINFORM CODE <pre><code>enter code here Dim Username = TxtUser.Text Dim PostData = "user_name=" & Username Dim request As WebRequest = WebRequest.Create(...
  • VB6 http post 发送与返回内容处理
  • vb Post XML 对象

    2013-09-08 20:13:00
    '先引入Microsoft XML,v4.0 ...Function PostXML(url As String, xml As String) As String Dim I As Integer 'xml = "<?xml version=" & Chr(34) & "1.0" & Chr(34) & " encodin...
  • 主要介绍了VB使用XMLHTTP实现Post与Get的方法,有一定的借鉴价值,需要的朋友可以参考下
  • VB INET控制post提交网页表单源码

    热门讨论 2011-12-04 13:22:24
    VB INET控制post提交网页表单源码
  • vbPostMessage

    2011-03-09 10:04:25
    该函数将一个消息放入(寄送)到与指定窗口创建的线程相联系... 函数原型:B00L PostMessage(HWND hWnd,UINT Msg,WPARAM wParam,LPARAM lParam); 参数 hWnd:其窗口程序接收消息的窗口的句柄。可取有特定...
  • vb.net Post 数据

    2013-05-20 14:45:00
    我想通过一个按钮 一个文本框。文本框里显示“你好”,当我单机按钮的时候。 将这个“你好” 提交到服务器的数据库里面,然后在一个网页上显示出来。 请问怎么做? 用什么类或是对象? 谢谢。
  • VB GET-POST

    2013-09-08 20:11:00
    (xml.responseBody, vbUnicode) ' 返回的内容 End If PostData = str1 End Function ' ==========新方法获取网页源码=============== ' 需要Inet ' 新获取网页源码方法Inet Function ...
  • vb l利用Inet 控件 post 数据包,实现部分功能 供新手 学习用,望高手 改进!!有意见加 QQ278698593探讨
  • VBpost登录百度

    2016-09-25 22:49:38
    VB利用post登录百度,刚刚请教了一位朋友,但是还是有些问题不是很了解,百度跟普通网站不一样,百度需要提交的参数太多,这些参数还不是明文,也可能是随机,有没有哪个朋友再祝我一把!
  • VB利用post登陆网页webqq简单一例,通过WEB在VB窗体中登录QQ,仅此功能,发上来供有用者参考,牵扯验证码验证之类的东西
  • vb+get/post+dll+webservice DEMO vb+get/post+dll+webservice DEMO
  • Dim strAdminEmail As String =...""Public strURL As String = ""Public strMoney As String = ""Public bLogin As Boolean = False LoginPost.aspx {0}.vb Imports B_String.FunnyImports System.Data.OdbcImports B_...
  • VB post注册的问题

    2012-11-04 18:28:12
    哪位高人写过post注册yy的例子没,请指教指教小弟,不知道是不是要对cookie操作,下面是post的代码,但是post后获得的源码总是"您当前的IP访问太频繁,请过一段时间再试".请各位大大帮小弟分析分析,谢过~ Web...
  • VB里 获取 VB里的web浏览器提交的数据,比如 浏览器向网站get了一下,或者post了一下 ,vb获取它的请求地址跟get地址还有参数?就像IE9的网络
  • VB.NET通过URL POST请求和GET请求

    千次阅读 2017-05-16 16:40:24
    VB.NET
  • VFP VB多线程下载http https Post Get网络组件,内部封装了 HttpGet HttpPost HttpDown 带回调,显示进度。
  • 用于顶贴,制作源码的案例.主要是给大家一个VB源码对于网页内容的获取和填写案例
  • VB.net 通过WebRequest 发送post请求 如何获取http响应

空空如也

空空如也

1 2 3 4 5 ... 20
收藏数 835
精华内容 334
关键字:

postvb