vb调用winInet API接口post数据到指定的url[1]

[入库:2005年8月18日] [更新:2007年3月24日]

本文简介:选择自 coolstar 的 blog

源代码推荐:vb调用wininet api接口post数据到指定的url

'this module is called modwininet.bas. use the splitaddr() function to get the address in the correct format for postinfo.

option explicit

'author:    sam huggill
'email:     sam@vbsquare.com

private declare function internetopen lib "wininet.dll" _
         alias "internetopena" _
            (byval lpszcallername as string, _
             byval dwaccesstype as long, _
             byval lpszproxyname as string, _
             byval lpszproxybypass as string, _
             byval dwflags as long) as long

      private declare function internetconnect lib "wininet.dll" _
            alias "internetconnecta" _
            (byval hinternetsession as long, _
             byval lpszservername as string, _
             byval nproxyport as integer, _
             byval lpszusername as string, _
             byval lpszpassword as string, _
             byval dwservice as long, _
             byval dwflags as long, _
             byval dwcontext as long) as long

   private declare function internetreadfile lib "wininet.dll" _
            (byval hfile as long, _
             byval sbuffer as string, _
             byval lnumbytestoread as long, _
             lnumberofbytesread as long) as integer

   private declare function httpopenrequest lib "wininet.dll" _
            alias "httpopenrequesta" _
            (byval hinternetsession as long, _
             byval lpszverb as string, _
             byval lpszobjectname as string, _
             byval lpszversion as string, _
             byval lpszreferer as string, _
             byval lpszaccepttypes as long, _
             byval dwflags as long, _
             byval dwcontext as long) as long

   private declare function httpsendrequest lib "wininet.dll" _
            alias "httpsendrequesta" _
            (byval hhttprequest as long, _
             byval sheaders as string, _
             byval lheaderslength as long, _
             byval soptional as string, _
             byval loptionallength as long) as boolean

   private declare function internetclosehandle lib "wininet.dll" _
            (byval hinternethandle as long) as boolean

   private declare function httpaddrequestheaders lib "wininet.dll" _
             alias "httpaddrequestheadersa" _

本文关键:vb url post
  相关方案
Google
 

本站最佳浏览方式为 分辨率 1024x768 IE 6.0(或更高版本的 IE浏览器)

go top