vbFTPClient - kb article 812404

  • Thread starter Thread starter Arne
  • Start date Start date
A

Arne

Hi

I've downloaded the vbFTPClient mentioned in kb article 812404, but I'm not
able to run it

It seems that the problem occurs in the main function, when trying to
convert from WebRequest to FtpWebRequest,

Dim ftp As FtpWebRequest

Try

ftp = Convert.ChangeType(w, GetType(FtpWebRequest))

'the gettype won't work !!

Catch

ftp = Nothing

End Try


any advice would be nice :-)


Arne
 
* "Arne said:
I've downloaded the vbFTPClient mentioned in kb article 812404, but I'm not
able to run it

It seems that the problem occurs in the main function, when trying to
convert from WebRequest to FtpWebRequest,

Dim ftp As FtpWebRequest

Try

ftp = Convert.ChangeType(w, GetType(FtpWebRequest))

'the gettype won't work !!

"Doesn't work"? Please be more specific.
 
When I activate the sample with parms. then at this points it gives a not
handled exception. This is due to the fact that the ftp variable equals
nothing, due to the code in my snippet.

The whole suspected part of code says: when reaching ftp.passive it comes up
with an unhandled exception
I guess the problem have something to do with the GetType(FtpWebRequest)
command ??


Arne

Dim w As WebRequest = WebRequest.Create(szUri)

w.Method = szMethod



Dim ftp As FtpWebRequest

Try

ftp = Convert.ChangeType(w, GetType(FtpWebRequest))

Catch

ftp = Nothing

End Try

ftp.Passive = fPassive


If I do a gettype(ftpwebrequest) in debug (immediate window) it says :
?gettype(FtpWebRequest)

Type 'FtpWebRequest' is not defined.
 
* "Arne said:
When I activate the sample with parms. then at this points it gives a not
handled exception. This is due to the fact that the ftp variable equals
nothing, due to the code in my snippet.

The whole suspected part of code says: when reaching ftp.passive it comes up
with an unhandled exception

What exception? Please post the exact message.
If I do a gettype(ftpwebrequest) in debug (immediate window) it says :
?gettype(FtpWebRequest)

Type 'FtpWebRequest' is not defined.

Maybe you missed a namespace?
 
Hi Herfried,
when it tries to access the ftp property (ftp.passive) it says that there
isn't an instance of the object (thats because the ftp variable is nothing),
so thats understandable.

I don't see how It can be anything with the namespace, as It accept the
declarence of a variable of that type
- dim ftp as ftpWebRequest

I'va digged a bit more :-)
The fptwebrequest is placed in a module and if i use the modulename in front
of the class the gettype works (thats new to me, that this is needed)

I've also implemented an errorhandler and now It says that the "Object must
implement IConvertible"

As stated earlier, it's a MS Sample I downloaded (without any changes from
my side) so It's supprisingly to me that it hasn't been tested (or could it
relate to my system ???)

Arne
 
Back
Top