#1
  1. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2002
    Location
    Philippines
    Posts
    30
    Rep Power
    13

    File Transfer using Direct Cable Connection


    I URGENTLY NEED HELP!

    I need a code in VB6 that will enable me to send files using Direct Cable Connection. I need this as a part of my project in school and I don't have any idea on how to implement it. Any help would be highly appreciated. Thanks in advance...
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2003
    Location
    St. Louis, MO USA
    Posts
    43
    Rep Power
    12
    There are various ways, one being to output directly to the port.

    I'll post a zip file including code I've used at one of my clients to talk RS-232, but if you want more than that, please specify what kind of cable you're using.
    - Chris of Custom Fit Technology
    http://www.customfittech.com

    Access to MySQL Conversion Tool,
    Visual XSLT Conversion Tool
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2003
    Location
    St. Louis, MO USA
    Posts
    43
    Rep Power
    12
    K here's the library reference:

    Microsoft Comm Control 6.0 (in the Components page)

    This means you need a Comm control little icon thingy on a form to reference as an object in code. Mine is called "com"

    Here's the code FOR LISTENING:
    com.CommPort = 1

    ' Set the port number
    com.Settings = "9600,N,8,1"
    ' you may not need to set anything for direct cable
    ' Tell the control to read entire buffer when Input is used
    com.InputLen = 0
    com.RThreshold = 1
    ' Open the port.
    com.InBufferSize = 8000
    com.PortOpen = True

    Here's the code FOR TALKIN':

    com.CommPort = 1

    ' Set the port number
    com.Settings = "9600,N,8,1" ' Set UART parameters
    com.PortOpen = True
    com.Output = s
    ' in my code, s is a string, in yours in may not, so maybe try
    ' a byte array?


    Hope this helped some
    Last edited by customfittech; March 1st, 2003 at 11:03 PM.
    - Chris of Custom Fit Technology
    http://www.customfittech.com

    Access to MySQL Conversion Tool,
    Visual XSLT Conversion Tool
  6. #4
  7. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2002
    Location
    Philippines
    Posts
    30
    Rep Power
    13
    Originally posted by customfittech
    There are various ways, one being to output directly to the port.

    I'll post a zip file including code I've used at one of my clients to talk RS-232, but if you want more than that, please specify what kind of cable you're using.
    Oh! sorry forgot to specify the cable. I don't know the exact name for it but I'll be using a cable for the Printer Port (DB25).
  8. #5
  9. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2002
    Location
    Philippines
    Posts
    30
    Rep Power
    13
    QUESTION:
    What if I'll use the Serial Port (DB9)? Is it possible? Will the source code change? (Please tell/show me how).

    Thank's for the code you've just given me. There's something I forgot to mention on my first post. Since it's only you who replied, I just hope you could do me a favor... (I might sound a "lamer" here but pardon me coz I'm a beginner in terms of Serial Programming (if that's what they call it).)

    Here it is...
    I'd like to implement a program that'll allow both users (on each end) to upload a file via Direct Cable Connection (may it be a DB25 or a DB9 cable). Let's say both Computers have a folder Downloads. When I upload a file to the other PC, it'll automatically be saved under the folder Downloads of the other computer connected to mine. Same goes if the other computer sends a file to me.

    It'll be of much help if you could send me a ZIP (which includes the .vbp, .frm, etc.) file for the Project. (Please) Coz I really need to finish my program before Feb 5. I'm really loosing hope on this...

IMN logo majestic logo threadwatch logo seochat tools logo