Type a page name and press Enter. You'll jump to the page if it exists, or you can create it if it doesn't.
To create a page in a module other than wininet, prefix the name with the module name and a period.
Declare Function FtpFindFirstFile Lib "wininet.dll" _
(ByVal hConnect As IntPtr, ByVal searchFile As String, _
ByRef findFileData As WIN32_FIND_DATA, ByVal flags As Integer, _
ByVal context As IntPtr) As IntPtr
For VB.net FtpFindFirstFile will {or May} return the folder and not a file.
Using
bRet = InternetFindNextFile(hFind, pData)
after FtpFindFirstFile will then return a file. For VAX servers the return string
may contain other information e.g. Date modified. This means you will need to parse
the text to just get the file name. Placeing the InternetFindNextFile in a do loop
will allow you to obtain a list of all the files in the server folder.
Note pData here is the storage defined by WIN32_FIND_DATA. I have placed
Note pData here is the storage defined by WIN32. I have placed
the structure I used in this structure information page.
Sample Code:
Do
'
bRet = InternetFindNextFile(hFind, pData)
'
If Not bRet Then
Procces the error here and quit
Else
Pos = InStr(pData.cFileName, " ") ' The file name should be at the start of the line
If Pos > 0 Then
strItemName = Trim(Left(pData.cFileName, Pos)) ' Get the file name
End If
' Add the name to a list - Could be a list box as below or Text box
Form1.List_Files.Items.Add(strItemName)
Loop
'
InternetCloseHandle(hFind) ' close the handle.
End Sub
Contains information about the file that is found by the FindFirstFile, FindFirstFileEx, or FindNextFile function.
11/10/2021 10:35:50 AM - -62.91.108.152
Contains information about the file that is found by the FindFirstFile, FindFirstFileEx, or FindNextFile function.
11/10/2021 10:35:50 AM - -62.91.108.152
Searches the specified directory of the given FTP session. File and directory entries are returned to the application in the [WIN32_FIND_DATA] structure.
5/10/2012 9:46:27 AM - -86.80.122.64
Searches the specified directory of the given FTP session. File and directory entries are returned to the application in the [WIN32_FIND_DATA] structure.
5/10/2012 9:46:27 AM - -86.80.122.64
Continues a file search started as a result of a previous call to FtpFindFirstFile or GopherFindFirstFile.
3/16/2007 8:34:49 AM - IanEmmons-64.65.207.127
Contains information about the file that is found by the FindFirstFile, FindFirstFileEx, or FindNextFile function.
11/10/2021 10:35:50 AM - -62.91.108.152
Please edit this page!
Do you have...
helpful tips or sample code to share for using this API in managed code?
corrections to the existing content?
variations of the signature you want to share?
additional languages you want to include?
Select "Edit This Page" on the right hand toolbar and edit it! Or add new pages containing supporting types needed for this API (structures, delegates, and more).