Results 1 to 6 of 6

Thread: Replacement for Winsock?!?

  1. #1

    Thread Starter
    Junior Member
    Join Date
    May 2002
    Location
    London,UK
    Posts
    16

    Unhappy Replacement for Winsock?!?

    A program that I'm writing at the moment needs to connect to FTP servers. When connected, I change to the 'specified' directory and then I need to look for files that meet a certain file criterea. Any files found that meet this criterea are to be moved off of the server (using get and del commands) to a temporary directory before I connect to another FTP server and move the files to a specified directory on there.

    Apparently we shouldn't use the Winsock controls in VB.Net bacause of performance issues with wrapped COM components.

    I assume there is a real easy way of doing what I want within the .Net Fx(?!?)

    Unfortunately all I can find in the online documentation is references to the HINTERNET handle with no real life example of how to implement it and besides, this looks far more complex than the Winsock control!

    Will the WebClient control give me all the functionality i need? I notice that the WebClient control allows me to upload and download files, but I can't see any way of deleting files.

    Or maybe somebody knows an even easier way?!?

    Help, please!!!

  2. #2
    Addicted Member
    Join Date
    Mar 2001
    Location
    Devon, UK
    Posts
    181
    Use the system.net namespace and the FileWebRequest class.
    Wind and waves resolves all problems.

  3. #3

    Thread Starter
    Junior Member
    Join Date
    May 2002
    Location
    London,UK
    Posts
    16
    Ok. Could somebody just give me a quick crash course on how to use the System.Net.FileWebRequest namespace - The online documentation gives no real examples of what commands to use and in which order things should be done in.

    Ta.

  4. #4
    Addicted Member
    Join Date
    Mar 2001
    Location
    Devon, UK
    Posts
    181
    This is in C# but might give you an idea. Let me knowif you find a VB example.
    http://www.c-sharpcorner.com/Tools/BasicFTPPL.asp
    Wind and waves resolves all problems.

  5. #5

    Thread Starter
    Junior Member
    Join Date
    May 2002
    Location
    London,UK
    Posts
    16
    I don't have C# so couldn't read the source code. I think I should be concentrating on the System.Net namespace to do this but can't find a decent example anywhere of how to go about it. Any ideas???!?

  6. #6
    hellswraith
    Guest
    You can open the C# source code in Notepad. You don't need the IDE. Hell, you can write your C# code in notepad all the way, and compile it using the free compiler that is with the framework.

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