vbFTPClient - kb article 812404

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Arne

    vbFTPClient - kb article 812404

    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.ChangeT ype(w, GetType(FtpWebR equest))

    'the gettype won't work !!

    Catch

    ftp = Nothing

    End Try


    any advice would be nice :-)


    Arne





  • Herfried K. Wagner [MVP]

    #2
    Re: vbFTPClient - kb article 812404

    * "Arne" <dontuse@micros oft.com> scripsit:[color=blue]
    > 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.ChangeT ype(w, GetType(FtpWebR equest))
    >
    > 'the gettype won't work !![/color]

    "Doesn't work"? Please be more specific.

    --
    Herfried K. Wagner [MVP]
    <URL:http://dotnet.mvps.org/>

    Comment

    • Arne

      #3
      Re: vbFTPClient - kb article 812404

      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(FtpWebR equest)
      command ??


      Arne

      Dim w As WebRequest = WebRequest.Crea te(szUri)

      w.Method = szMethod



      Dim ftp As FtpWebRequest

      Try

      ftp = Convert.ChangeT ype(w, GetType(FtpWebR equest))

      Catch

      ftp = Nothing

      End Try

      ftp.Passive = fPassive


      If I do a gettype(ftpwebr equest) in debug (immediate window) it says :
      ?gettype(FtpWeb Request)

      Type 'FtpWebRequest' is not defined.



      "Herfried K. Wagner [MVP]" <hirf-spam-me-here@gmx.at> wrote in message
      news:2hmj54Fegg siU4@uni-berlin.de...
      [color=blue]
      > * "Arne" <dontuse@micros oft.com> scripsit:[color=green]
      > > I've downloaded the vbFTPClient mentioned in kb article 812404, but I'm[/color][/color]
      not[color=blue][color=green]
      > > 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.ChangeT ype(w, GetType(FtpWebR equest))
      > >
      > > 'the gettype won't work !![/color]
      >
      > "Doesn't work"? Please be more specific.
      >
      > --
      > Herfried K. Wagner [MVP]
      > <URL:http://dotnet.mvps.org/>[/color]


      Comment

      • Herfried K. Wagner [MVP]

        #4
        Re: vbFTPClient - kb article 812404

        * "Arne" <dontuse@micros oft.com> scripsit:[color=blue]
        > 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[/color]

        What exception? Please post the exact message.
        [color=blue]
        > If I do a gettype(ftpwebr equest) in debug (immediate window) it says :
        > ?gettype(FtpWeb Request)
        >
        > Type 'FtpWebRequest' is not defined.[/color]

        Maybe you missed a namespace?

        --
        Herfried K. Wagner [MVP]
        <URL:http://dotnet.mvps.org/>

        Comment

        • Arne

          #5
          Re: vbFTPClient - kb article 812404

          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

          "Herfried K. Wagner [MVP]" <hirf-spam-me-here@gmx.at> wrote in message
          news:2hn3gkFek0 cnU2@uni-berlin.de...[color=blue]
          > * "Arne" <dontuse@micros oft.com> scripsit:[color=green]
          > > When I activate the sample with parms. then at this points it gives a[/color][/color]
          not[color=blue][color=green]
          > > 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[/color][/color]
          comes up[color=blue][color=green]
          > > with an unhandled exception[/color]
          >
          > What exception? Please post the exact message.
          >[color=green]
          > > If I do a gettype(ftpwebr equest) in debug (immediate window) it says :
          > > ?gettype(FtpWeb Request)
          > >
          > > Type 'FtpWebRequest' is not defined.[/color]
          >
          > Maybe you missed a namespace?
          >
          > --
          > Herfried K. Wagner [MVP]
          > <URL:http://dotnet.mvps.org/>[/color]


          Comment

          Working...