I suspect your problem lies in your declaration of the
WIN32_FIND_DATA
structure. Including string fields in an Windows API data structure usualy requires something more complex than a simple
Public strField As String
declaration.
I find the
P/Invoke website[
^] a useful resource in such circumstances. You should investigate their definition of the
WIN32_FIND_DATA[
^] data structure. I'd also recommend checking the declaration of the
FtpFindFirstFile[
^] and compare it with your declaration.
Let me add that I also agree with Gregory Gadow's post. If you are using VB.NET, it is generally better to use the appropriate Framework classes.