' Initializes an application's use of the Win32 Internet functions
Private Declare Function InternetOpen Lib "wininet.dll" Alias "InternetOpenA"
_
(ByVal sAgent As String, ByVal lAccessType As Long, ByVal sProxyName As String,
_
ByVal sProxyBypass As String, ByVal lFlags As Long) As Long
' Use registry access settings.
Private Const INTERNET_OPEN_TYPE_PRECONFIG = 0
' Opens a HTTP session for a given site.
Private Declare Function InternetConnect Lib "wininet.dll" Alias "InternetConnectA"
_
(ByVal hInternetSession As Long, ByVal sServerName As String, ByVal nServerPort
As Integer, _
ByVal sUsername As String, ByVal sPassword As String, ByVal lService As Long,
_
ByVal lFlags As Long, ByVal lContext As Long) As Long
' Number of the TCP/IP port on the server to connect to.
Private Const INTERNET_DEFAULT_FTP_PORT = 21
Private Const INTERNET_DEFAULT_GOPHER_PORT = 70
Private Const INTERNET_DEFAULT_HTTP_PORT = 80
Private Const INTERNET_DEFAULT_HTTPS_PORT = 443
Private Const INTERNET_DEFAULT_SOCKS_PORT = 1080
' Type of service to access.
Private Const INTERNET_SERVICE_FTP = 1
Private Const INTERNET_SERVICE_GOPHER = 2
Private Const INTERNET_SERVICE_HTTP = 3
' Opens an HTTP request handle.
Private Declare Function HttpOpenRequest Lib "wininet.dll" Alias "HttpOpenRequestA"
_
(ByVal hHttpSession As Long, ByVal sVerb As String, ByVal sObjectName As String,
ByVal sVersion As String, _
ByVal sReferer As String, ByVal something As Long, ByVal lFlags As Long, ByVal
lContext As Long) As Long
' Brings the data across the wire even if it locally cached.
Private Const INTERNET_FLAG_RELOAD = &H80000000
Private Const INTERNET_FLAG_SECURE = &H800000
' Sends the specified request to the HTTP server.
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 Integer
' Reads data from a handle opened by the HttpOpenRequest function.
Private Declare Function InternetReadFile Lib "wininet.dll" _
(ByVal hFile As Long, ByVal sBuffer As String, ByVal lNumBytesToRead As Long,
_
lNumberOfBytesRead As Long) As Integer
' Closes a single Internet handle or a subtree of Internet handles.
Private Declare Function InternetCloseHandle Lib "wininet.dll" _
(ByVal hInet As Long) As Integer
' Queries an Internet option on the specified handle
Private Declare Function InternetQueryOption Lib "wininet.dll" Alias "InternetQueryOptionA"
_
(ByVal hInternet As Long, ByVal lOption As Long, ByRef sBuffer As Any, ByRef
lBufferLength As Long) As Integer
' Adds one or more HTTP request headers to the HTTP request handle.
Private Declare Function HttpAddRequestHeaders Lib "wininet.dll" Alias "HttpAddRequestHeadersA"
_
(ByVal hHttpRequest As Long, ByVal sHeaders As String, ByVal lHeadersLength
As Long, _
ByVal lModifiers As Long) As Integer
' Replaces or removes a header. If the header value is empty and the header is
found,
' it is removed. If not empty, the header value is replaced
Private Const HTTP_ADDREQ_FLAG_REPLACE = &H80000000
POSTing Form Data to a Web Page
- Introduction
- ServerXMLHTTP Object
- WinINet API Functions
- Posting a File
- Declarations and Constants
Declarations and Constants
You might also like...
About the author
Bruce Johnson
I am the owner of a small application development consulting company that specialized in the design and implementation of Internet-based applications. While there are others who can make a web ...
Interested in writing for us? Find out more.
XML books
-
Programming with Microsoft Visual Basic 2008
Programming with Microsoft Visual Basic 2008, Fourth Edition by the best-selling author, Diane Zak, is designed for a first course in programming. Using the most recent version of the software, Visual Basic 2008, this book teaches individuals how to ...
XML forum discussion
-
CorelDRAW VBA: cdrTraceLineDrawing FAILS, producing single linear path instead of Centerline trace?
by dancemanj (0 replies)
-
client/server application using activex
by beautifulheart (0 replies)
-
System Error &H8007007E. The specifed module could not be found.
by swiftsafe (5 replies)
-
Invitation to take part in an academic research study
by researchlab (0 replies)
-
Send SMS with SMPP
by mmahmoud (0 replies)
XML podcasts
-
Stack Overflow Podcast: Podcast #45 – Keeping it Sharp
Published 7 years ago, running time 0h54m
Our guest this week is Eric Lippert – language architect extraordinaire and famous for all his work at Microsoft in developing their languages Eric joined Microsoft right out of college and was originally working on VB It’s time for everyone’s favorite game: Name the Worst Feature of that Microso.
Comments