Jump to content

Sending Text


 Share

Recommended Posts

Is there a way i could send a text file to someone over the internet? I made test programs to try it...

Server

#include <guiconstants.au3>

$ServerWin = GUICreate("Text Transfer Test - Server", 500, 120)
$Going = 0
$a = 0
$f = ""
$FileDest = GUICtrlCreateInput(@MyDocumentsDir, 10, 12, 390, 18)
$Browse = GUICtrlCreateButton("&Browse...", 400, 8, 75, 25)
$Go = GUICtrlCreateButton("&Start", 170, 55, 90, 30)

GUISetState(@SW_SHOW, $ServerWin)

While 1
    $msg = GUIGetMsg()
    Select
        Case $msg = $GUI_EVENT_CLOSE
            Exit
        Case $msg = $Browse
            BROWSE()
        Case $msg = $Go
            RunServ()
    EndSelect
    If @error Then MsgBox(1, "Uh Oh", "Holy, you broke it numbnuts!", 3500)
    If $a = 1 Then
        $f = TCPAccept($Listen)
    EndIf
WEnd

Func BROWSE()
    $dir = FileSelectFolder("Select A Directory", @MyDocumentsDir)
    GUICtrlSetData($FileDest, $dir)
EndFunc

Func RunServ()
    If $Going = 0 Then
        $Going = 1
        GUICtrlSetData($Go, "Stop")
        TCPStartup()
        Global $Listen = TCPListen(@IPAddress1, 1234)
        $a = 1
    ElseIf $Going = 1 Then
        $Going = 0
        FileWrite(GUICtrlRead($FileDest)&"\sentfile.txt", $f)
        GUICtrlSetData($Go, "Start")
        $a = 0
        TCPShutdown()
    Else
        MsgBox(1, "Uh Oh", "Holy, you broke it numbnuts!", 3500)
    EndIf
EndFunc

Is it possible to do it?

What I tried to do was send the text in the file to the server and the server writes that to a file. It only puts "-1" in the file....

-Joscpe

Link to comment
Share on other sites

That... That was productive.

Anyways, check out YAC-P and erifash's chat program that use TCP commands. Those will shed some light on the inner working of TCP :P

Ha, I haven't been on these forums since... 2006, almost. Behold, my legacy signature:My AutoIt idol is Valuater. You know you love him, too.My Stuff: D&D AGoT Tools Suite
Link to comment
Share on other sites

I downloaded it, i fixed the links to where i put the files and i compiles them. I get an error refering to the server file:

Global $List[$MaxUsers][2] ;[ index ][ socket, username ]

NVM, just had to add into the INI file

I guess I'll just read through the code...

Also... How do you make a skin? :P

Edited by Joscpe

-Joscpe

Link to comment
Share on other sites

The search button is your friend:

Searched the word "skin"

~Projects~1. iPod Ejector 1.0 - Tool Used To Eject iPod in Windows - Uses DevEject.exe :P2. SmartFTP Close Popup Tool - Closes reminders from freeware SmartFTP.~Helpful Links For New Users~1. LXP's Learning AutoIT PDF Guide - <<< Go here for a PDF Guide on learning AutoIT from the ground up!<<<2. AutoIt 1-2-3 <<<Want to learn more about AutoIT quickly? Go Here<<<3. How To Install The Beta And Production Versions Of AutoIT / SciteAutoIT

Link to comment
Share on other sites

I made a script about a year ago

http://www.autoitscript.com/forum/index.ph...mp;#entry135054

this can send binary files over internet.

(ow yeah the useless reply at the bottom did not test his source mine actually worked)

its a bit old now but it still works (some gui things donot seem to work)

Larger files always got screwed up because of bad buffer reading so I made a flow control system.

Maybe nice to check maybe not:P

Edited by MrSpacely
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...