Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

WIN32_FIND_DATA known problems with the InternetFindNextFile

Status
Not open for further replies.

reszek

Programmer
Jul 3, 2002
16
0
0
CA
Hey i am trying to read the list of file names in a directory and my ftpfindfirstfile works but my internetFindNextFile does not. could anyone possibly give me a hand if they have worked with this before?

here is the code, i know i can open and connect properly, and all of my varibles are declared properly, so for the sake of security (and readability) im just going to post the part that applies

hFileConnection = FtpFindFirstFile(hConnection, "*.csv", win32Con, 0, 0)
If hFileConnection Then
bResult = True
Do While bResult
ReDim Preserve sFileNames(i) 'this is like adding another element to the array because each time it goes through the loop i increases by one
nFileSize = InStr(1, win32Con.cFileName, Chr(0)) - 1
If nFileSize = 0 Then 'Null character (delimeter) not found
nFileSize = Len(win32Con.cFileName)
End If
sFileNames(i) = Mid(win32Con.cFileName, 1, nFileSize)
bResult = InternetFindNextFile(hFileConnection, win32Con)
i = i + 1

Loop
If hFileConnection Then 'now that we are done
CloseFtpConnection 'loading data we can close the file
End If 'connection, if there was one open
End If
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top