Results 1 to 4 of 4

Thread: ftp - is there a neater way to do this?

  1. #1

    Thread Starter
    Hyperactive Member stingrae's Avatar
    Join Date
    Apr 2002
    Location
    Sydney
    Posts
    401

    ftp - is there a neater way to do this?

    I've written a little routine for an app that takes a file from my local computer here and uloads it to my website:

    Code:
            Dim myFile As IO.File
            Dim SW As IO.StreamWriter
            SW = myFile.AppendText(cWorkFile)
            SW.WriteLine("open www.stingrae.com.au")
            SW.WriteLine(cUserID)
            SW.WriteLine(cPassword)
            SW.WriteLine("put " & cFileName)
            SW.WriteLine("quit")
            SW.Close()
            Dim p As Process
            p.Start("ftp -s:" & cWorkFile)
            myFile.Delete(cWorkFile)
    the code works, but being the perfectionist that i am, i would really prefer a better scenario. like, at the moment, i have no idea whether it connects or works or anything! what's worse, is that if it doesn't work, then the user id & password are both sitting in a plain text file on the local pc! aaaahhhh!!

    are there any neat vb.net commands to do this? surely with all the technology now available, puting a file on a web site should be simple?
    "The passion lives to keep your faith, though all are different, all are great" ... Michael Hutchence 1960-1997.

    Windows & Web Developer
    Specialising in Visual Basic .Net & Client Server Programming & Client/Customer Relations Databases
    Sutherland Shire, Sydney Australia
    www.stingrae.com.au
    Developer of Arnold - Gym & Martial Arts Database Management System
    www.gymdatabase.com.au

  2. #2
    yay gay PT Exorcist's Avatar
    Join Date
    Apr 2002
    Location
    . . . my reason of shame
    Posts
    2,729
    sure there are a lot of ways of doin this:

    they're all in System.Net, you can use System.Net.Sockets...but look at allapi.net they have a download class for HTTP and FTP on the .NET classes part of the site, it includes progress and everything
    \m/\m/

  3. #3

    Thread Starter
    Hyperactive Member stingrae's Avatar
    Join Date
    Apr 2002
    Location
    Sydney
    Posts
    401
    cool. thanks for that. i just checked out the site and it looks very useful.

    i'll try a few and see how i go.

    "The passion lives to keep your faith, though all are different, all are great" ... Michael Hutchence 1960-1997.

    Windows & Web Developer
    Specialising in Visual Basic .Net & Client Server Programming & Client/Customer Relations Databases
    Sutherland Shire, Sydney Australia
    www.stingrae.com.au
    Developer of Arnold - Gym & Martial Arts Database Management System
    www.gymdatabase.com.au

  4. #4

    Thread Starter
    Hyperactive Member stingrae's Avatar
    Join Date
    Apr 2002
    Location
    Sydney
    Posts
    401
    i'm guessing that this is the function that i want:

    FTP Put File

    but i can't figure out how it works. at the bottom it says that there's no .Net example available.

    is anyone able to post a .Net example?

    thanks
    "The passion lives to keep your faith, though all are different, all are great" ... Michael Hutchence 1960-1997.

    Windows & Web Developer
    Specialising in Visual Basic .Net & Client Server Programming & Client/Customer Relations Databases
    Sutherland Shire, Sydney Australia
    www.stingrae.com.au
    Developer of Arnold - Gym & Martial Arts Database Management System
    www.gymdatabase.com.au

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width