[13] | 1 | Attribute VB_Name = "FTPModule" |
---|
| 2 | Option Explicit |
---|
| 3 | |
---|
| 4 | Public Declare Function InternetOpen Lib "wininet.dll" Alias "InternetOpenA" _ |
---|
| 5 | (ByVal sAgent As String, ByVal lAccessType As Long, ByVal sProxyName As String, _ |
---|
| 6 | ByVal sProxyBypass As String, ByVal lFlags As Long) As Long |
---|
| 7 | |
---|
| 8 | Public Declare Function InternetConnect Lib "wininet.dll" Alias "InternetConnectA" _ |
---|
| 9 | (ByVal hInternetSession As Long, ByVal sServerName As String, _ |
---|
| 10 | ByVal nServerPort As Integer, ByVal sUsername As String, _ |
---|
| 11 | ByVal sPassword As String, ByVal lService As Long, _ |
---|
| 12 | ByVal lFlags As Long, ByVal lContext As Long) As Long |
---|
| 13 | |
---|
| 14 | Public Declare Function FtpGetFile Lib "wininet.dll" Alias "FtpGetFileA" _ |
---|
| 15 | (ByVal hFtpSession As Long, ByVal lpszRemoteFile As String, _ |
---|
| 16 | ByVal lpszNewFile As String, ByVal fFailIfExists As Boolean, _ |
---|
| 17 | ByVal dwFlagsAndAttributes As Long, ByVal dwFlags As Long, _ |
---|
| 18 | ByVal dwContext As Long) As Boolean |
---|
| 19 | |
---|
| 20 | Public Declare Function FtpPutFile Lib "wininet.dll" Alias "FtpPutFileA" _ |
---|
| 21 | (ByVal hFtpSession As Long, ByVal lpszLocalFile As String, _ |
---|
| 22 | ByVal lpszRemoteFile As String, ByVal dwFlags As Long, _ |
---|
| 23 | ByVal dwContext As Long) As Boolean |
---|
| 24 | |
---|
| 25 | Public Declare Function FtpDeleteFile Lib "wininet.dll" Alias "FtpDeleteFileA" _ |
---|
| 26 | (ByVal hFtpSession As Long, ByVal lpszFileName As String) As Boolean |
---|
| 27 | |
---|
| 28 | Public Declare Function FtpRenameFile Lib "wininet.dll" Alias "FtpRenameFileA" _ |
---|
| 29 | (ByVal hFtpSession As Long, ByVal lpszExsiting As String, ByVal lpszNew As String) As Boolean |
---|
| 30 | |
---|
| 31 | Public Declare Function InternetCloseHandle Lib "wininet.dll" (ByVal hInet As Long) As Integer |
---|
| 32 | |
---|
| 33 | Public Declare Function FtpFindFirstFile Lib "wininet.dll" Alias "FtpFindFirstFileA" _ |
---|
| 34 | (ByVal hFtpSession As Long, ByVal lpszSearchFile As String, _ |
---|
| 35 | lpFindFileData As WIN32_FIND_DATA, ByVal dwFlags As Long, _ |
---|
| 36 | ByVal dwContent As Long) As Long |
---|
| 37 | |
---|
| 38 | Public Declare Function FtpSetCurrentDirectory Lib "wininet.dll" Alias "FtpSetCurrentDirectoryA" _ |
---|
| 39 | (ByVal hFtpSession As Long, ByVal lpszDirectory As String) As Boolean |
---|
| 40 | |
---|
| 41 | Public Declare Function InternetFindNextFile Lib "wininet.dll" Alias "InternetFindNextFileA" _ |
---|
| 42 | (ByVal hFind As Long, lpvFndData As WIN32_FIND_DATA) As Long |
---|
| 43 | |
---|
| 44 | Public Type FILETIME |
---|
| 45 | dwLowDateTime As Long |
---|
| 46 | dwHighDateTime As Long |
---|
| 47 | End Type |
---|
| 48 | Public Type WIN32_FIND_DATA |
---|
| 49 | dwFilAttributes As Long |
---|
| 50 | ftCreationTime As FILETIME |
---|
| 51 | ftLastAccessTime As FILETIME |
---|
| 52 | ftLastWriteTime As FILETIME |
---|
| 53 | nFileSizeHigh As Long |
---|
| 54 | nFileSizeLow As Long |
---|
| 55 | dwReserved0 As Long |
---|
| 56 | dwReserved1 As Long |
---|
| 57 | cFileName As String * 260 |
---|
| 58 | cAlternate As String * 14 |
---|
| 59 | End Type |
---|
| 60 | |
---|
| 61 | |
---|
| 62 | Public Declare Function GetOpenFileName Lib "comdlg32.dll" Alias _ |
---|
| 63 | "GetOpenFileNameA" (pOpenfilename As OPENFILENAME) As Long |
---|
| 64 | |
---|
| 65 | Type OPENFILENAME |
---|
| 66 | lStructSize As Long |
---|
| 67 | hwndOwner As Long |
---|
| 68 | hInstance As Long |
---|
| 69 | lpstrFilter As String |
---|
| 70 | lpstrCustomFilter As String |
---|
| 71 | nMaxCustFilter As Long |
---|
| 72 | nFilterIndex As Long |
---|
| 73 | lpstrFile As String |
---|
| 74 | nMaxFile As Long |
---|
| 75 | lpstrFileTitle As String |
---|
| 76 | nMaxFileTitle As Long |
---|
| 77 | lpstrInitialDir As String |
---|
| 78 | lpstrTitle As String |
---|
| 79 | flags As Long |
---|
| 80 | nFileOffset As Integer |
---|
| 81 | nFileExtension As Integer |
---|
| 82 | lpstrDefExt As String |
---|
| 83 | lCustData As Long |
---|
| 84 | lpfnHook As Long |
---|
| 85 | lpTemplateName As String |
---|
| 86 | End Type |
---|
| 87 | |
---|
| 88 | Public Const INTERNET_FLAG_RELOAD = &H80000000 |
---|
| 89 | Public Const FTP_TRANSFER_TYPE_BINARY = &H2 |
---|
| 90 | Public Const FTP_TRANSFER_TYPE_ASCII = &H1 |
---|