1 | ' api_wininet.sbp
|
---|
2 |
|
---|
3 | #ifdef UNICODE
|
---|
4 | Const _FuncName_InternetOpen = "InternetOpenW"
|
---|
5 | Const _FuncName_InternetConnect = "InternetConnectW"
|
---|
6 | Const _FuncName_FtpGetFile = "FtpGetFileW"
|
---|
7 | Const _FuncName_FtpGetCurrentDirectory = "FtpGetCurrentDirectoryW"
|
---|
8 | Const _FuncName_FtpSetCurrentDirectory = "FtpSetCurrentDirectoryW"
|
---|
9 | Const _FuncName_FtpFindFirstFile = "FtpFindFirstFileW"
|
---|
10 | Const _FuncName_InternetFindNextFile = "InternetFindNextFileW"
|
---|
11 | #else
|
---|
12 | Const _FuncName_InternetOpen = "InternetOpenA"
|
---|
13 | Const _FuncName_InternetConnect = "InternetConnectA"
|
---|
14 | Const _FuncName_FtpGetFile = "FtpGetFileA"
|
---|
15 | Const _FuncName_FtpGetCurrentDirectory = "FtpGetCurrentDirectoryA"
|
---|
16 | Const _FuncName_FtpSetCurrentDirectory = "FtpSetCurrentDirectoryA"
|
---|
17 | Const _FuncName_FtpFindFirstFile = "FtpFindFirstFileA"
|
---|
18 | Const _FuncName_InternetFindNextFile = "InternetFindNextFileA"
|
---|
19 | #endif
|
---|
20 |
|
---|
21 | TypeDef HINTERNET = VoidPtr
|
---|
22 |
|
---|
23 | TypeDef INTERNET_PORT = Word
|
---|
24 |
|
---|
25 |
|
---|
26 | Const INTERNET_FLAG_RELOAD = &H80000000 'retrieve the original item
|
---|
27 |
|
---|
28 |
|
---|
29 | Const FTP_TRANSFER_TYPE_UNKNOWN = &H00000000
|
---|
30 | Const FTP_TRANSFER_TYPE_ASCII = &H00000001
|
---|
31 | Const FTP_TRANSFER_TYPE_BINARY = &H00000002
|
---|
32 |
|
---|
33 |
|
---|
34 | Const INTERNET_OPEN_TYPE_PRECONFIG = 0 'use registry configuration
|
---|
35 | Const INTERNET_OPEN_TYPE_DIRECT = 1 'direct to net
|
---|
36 | Const INTERNET_OPEN_TYPE_PROXY = 3 'via named proxy
|
---|
37 | Const INTERNET_OPEN_TYPE_PRECONFIG_WITH_NO_AUTOPROXY = 4 'prevent using java/script/INS
|
---|
38 |
|
---|
39 | Declare Function InternetOpen Lib "wininet.dll" Alias _FuncName_InternetOpen (
|
---|
40 | lpszAgent As LPCTSTR,
|
---|
41 | dwAccessType As DWord,
|
---|
42 | lpszProxy As LPCTSTR,
|
---|
43 | lpszProxyBypass As LPCTSTR,
|
---|
44 | dwFlags As DWord) As HINTERNET
|
---|
45 |
|
---|
46 | Const INTERNET_SERVICE_FTP = 1
|
---|
47 | Const INTERNET_SERVICE_GOPHER = 2
|
---|
48 | Const INTERNET_SERVICE_HTTP = 3
|
---|
49 |
|
---|
50 | Const INTERNET_FLAG_PASSIVE = &H08000000 'used for FTP connections
|
---|
51 |
|
---|
52 | Const INTERNET_INVALID_PORT_NUMBER = 0 'use the protocol-specific default
|
---|
53 | Const INTERNET_DEFAULT_FTP_PORT = 21 'default for FTP servers
|
---|
54 | Const INTERNET_DEFAULT_GOPHER_PORT = 70 ' " " gopher "
|
---|
55 | Const INTERNET_DEFAULT_HTTP_PORT = 80 ' " " HTTP "
|
---|
56 | Const INTERNET_DEFAULT_HTTPS_PORT = 443 ' " " HTTPS "
|
---|
57 | Const INTERNET_DEFAULT_SOCKS_PORT = 1080 'default for SOCKS firewall servers.
|
---|
58 |
|
---|
59 | Declare Function InternetConnect Lib "wininet.dll" Alias _FuncName_InternetConnect (
|
---|
60 | hInternet As HINTERNET,
|
---|
61 | lpszServerName As LPCTSTR,
|
---|
62 | nServerPort As INTERNET_PORT,
|
---|
63 | lpszUserName As LPCTSTR,
|
---|
64 | lpszPassword As LPCTSTR,
|
---|
65 | dwService As DWord,
|
---|
66 | dwFlags As DWord,
|
---|
67 | dwContext As DWORD_PTR) As HINTERNET
|
---|
68 |
|
---|
69 | Declare Function InternetCloseHandle Lib "wininet.dll" (hInternet As HINTERNET) As BOOL
|
---|
70 |
|
---|
71 |
|
---|
72 |
|
---|
73 | '----------------
|
---|
74 | ' FTP
|
---|
75 | '----------------
|
---|
76 |
|
---|
77 | Declare Function FtpGetFile Lib "wininet.dll" Alias _FuncName_FtpGetFile (
|
---|
78 | hConnect As HINTERNET,
|
---|
79 | lpszRemoteFile As LPCTSTR,
|
---|
80 | lpszNewFile As LPCTSTR,
|
---|
81 | fFailIfExists As BOOL,
|
---|
82 | dwFlagsAndAttributes As DWord,
|
---|
83 | dwFlags As DWord,
|
---|
84 | dwContext As DWORD_PTR) As BOOL
|
---|
85 |
|
---|
86 | Declare Function FtpGetCurrentDirectory Lib "wininet.dll" Alias _FuncName_FtpGetCurrentDirectory (
|
---|
87 | hConnect As HINTERNET,
|
---|
88 | lpszCurrentDirectory As LPTSTR,
|
---|
89 | lpdwCurrentDirectory As DWord) As BOOL
|
---|
90 |
|
---|
91 | Declare Function FtpSetCurrentDirectory Lib "wininet.dll" Alias _FuncName_FtpSetCurrentDirectory (
|
---|
92 | hConnect As HINTERNET,
|
---|
93 | lpszDirectory As LPCTSTR) As BOOL
|
---|
94 |
|
---|
95 | Declare Function FtpFindFirstFile Lib "wininet.dll" Alias _FuncName_FtpFindFirstFile (
|
---|
96 | hConnect As HINTERNET,
|
---|
97 | lpszSearchFile As LPCTSTR,
|
---|
98 | ByRef FindFileData As WIN32_FIND_DATA,
|
---|
99 | dwFlags As DWord,
|
---|
100 | dwContext As DWORD_PTR) As HINTERNET
|
---|
101 |
|
---|
102 | Declare Function InternetFindNextFile Lib "wininet.dll" Alias _FuncName_InternetFindNextFile (
|
---|
103 | hFind As HINTERNET,
|
---|
104 | ByREf vFindData As Any) As BOOL
|
---|