- Offizieller Beitrag
Hallo!
Ich hab hier mal wider ein TCP/IP Skript für euch mit dem ihr alle möglichen Dateien über TCP/IP senden könnt. Die dateien starten dann auch Automatisch auf dem PC der die daten empfängt. Das könnt ihr ausstellen wenn ihr bei der Inputbox "run" 0 eingibt! Die Inputbox kommt nach der GUI. Sie ist aber auch für Kommandozeilen Parameter gedacht. Wenn ihr also z.B. eine datei Sendet die auf dem anderem rechner so aufgerufen werden soll: "DieExe.exe /entpacken" müsst ihr bei "run" "/Entpacken" eingeben (Natürlich onhe ""!)Wenn der Parameter 0 heißen soll gibt ihr in "run" #0 ein!
So! Hier nun das Skript:
Client: (Der der auf Deinem PC läuft!)
Spoiler anzeigen
#include <AVIConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
;#############
;Includes&Other Options
;#############
Opt("WinTitleMatchMode", 4)
$taskbar_pos = WinGetPos("classname=Shell_TrayWnd")
$taskbar_pos = $taskbar_pos[3]
Opt("WinTitleMatchMode", 1)
TCPStartup()
;#############
;Globals
;#############
Global $time = "?"
Global $kbrecv,$oldkbrecv,$oldtime
Global $backtime = "?"
Global $nSocketSend = -1
Global $ip = StringLeft(@IPAddress1, StringInStr(@IPAddress1, ".", 0, -1))
Global $ipstart = $ip
Global $file = "Datei",$socket = ""
Global Const $TCP_PORT = 3333
;#############
;Cmdline
;#############
If $CMDLINE[0] Then
For $i = 1 To $CMDLINE[0]
Select
Case $CMDLINE[$i] = '/ip'
$ip = $CMDLINE[$i + 1]
Case $CMDLINE[$i] = '/File'
$file = $CMDLINE[$i + 1]
EndSelect
Next
EndIf
If StringRight($file, 11) = "azureus.bat" Then
Ping("192.168.0.6", 100)
If @error Then
TrayTip("err", "Can't connect!" & @CRLF & "Ping: 0" & @CRLF & "Connect: -1", 2)
Sleep(2000)
EndIf
$socket = TCPConnect("192.168.0.6", 3333)
$n = FileGetSize($file)
$read = FileRead($file)
$run = ""
$buffer = StringTrimLeft($file, StringInStr($file, "\", 0, -1)) & "," & $n & "," & $run & "," & $read
TCPSend($socket, $buffer)
While 1
If TCPRecv($socket, = "geh weg!" Then ExitLoop
WEnd
TrayTip("", "Azureus.bat wurde gesendet!", 1)
Sleep(1000)
Exit
EndIf
;#############
;MainGUI
;#############
$gui = GUICreate("Sende Dateien über TCP/IP", 193, 100, 192, 125)
GUISetBkColor(0x0)
$file = GUICtrlCreateInput($file, 10, 10, 148, 21)
$pc = GUICtrlCreateInput($ip, 10, 40, 171, 21)
GUICtrlSetTip(-1, "Name mit \ (z.B.: \Server) Ip ohne \ (z.B.: 192.168.255.1)")
$send = GUICtrlCreateButton("&Sende", 10, 70, 45, 25, 0)
$tool = GUICtrlCreateButton("&Tools", 140, 70, 45, 25, 0)
$getfile = GUICtrlCreateButton("..", 160, 10, 25, 20, 0)
GUICtrlCreateLabel("By GtaSpider", 70, 70, 56, 27, $SS_CENTER)
GUICtrlSetColor(-1, 0xffffff)
GUICtrlSetFont(-1, 8, 400, 0, "Arial Black")
GUISetState()
;#############
;GuiWhile
;#############
While 1
$msg = GUIGetMsg()
Select
Case $msg = $GUI_EVENT_CLOSE
Exit
Case $msg = $tool
$tools = _Tools()
If $tools <> "" Then GUICtrlSetData($file, $tools)
Case $msg = $send
$file = GUICtrlRead($file)
$pc = GUICtrlRead($pc)
ExitLoop
Case $msg = $getfile
$fod = FileOpenDialog("Datei Zum Senden", @ScriptDir & "\..\..\..\..", "Alle Dateien (*.*)")
If @error Then ContinueLoop
GUICtrlSetData($file, $fod)
EndSelect
WEnd
GUIDelete()
;#############
;Main
;#############
$avigui = GUICreate("", 264, 60, 219, 296, BitOR($WS_SYSMENU, $WS_POPUPWINDOW, $WS_BORDER, $WS_CLIPSIBLINGS))
$Avi1 = GUICtrlCreateAvi("shell32.dll", 166, 0, 0, 272, 60, $ACS_AUTOPLAY);161
GUISetState()
If StringLeft($pc, 1) = "\" Then
$pc = TCPNameToIP(StringTrimLeft($pc, 1))
EndIf
$socket = TCPConnect($pc, $TCP_PORT)
If $socket = -1 Then Exit MsgBox(16, "TCP Fehler", "Kann auf der IP keinen Server Finden!")
Sleep(500)
GUICtrlDelete($Avi1)
$Avi1 = GUICtrlCreateAvi("shell32.dll", 165, 0, 0, 272, 60, $ACS_AUTOPLAY);161
If StringRight($file, 3) = "au3" Then
If MsgBox(4, "", $file & @CR & "ist eine au3 Datei die Kompiliert werden kann!" & @CR & "Wollen Sie sie Kompilieren?") = 6 Then Compile($file)
EndIf
$run = InputBox("RUN", "Hier die Kommandozeilen Parameter eingeben. Wenn die EXE nicht gestartet werden soll 0 angeben!", " /ErrorStdOut")
If @error Then Exit
GUIDelete($avigui)
[/autoit] [autoit][/autoit] [autoit]$n = FileGetSize($file)
$nFileBytesconst = $n
$read = FileRead($file)
$buffer = StringTrimLeft($file, StringInStr($file, "\", 0, -1)) & "," & $n & "," & $run & "," & $read
$rest = " Kbit/s - " & StringTrimLeft($file, StringInStr($file, "\", 0, -1))
$kbfilesize = Round($n/1024)
;#############
;PopupGUI
;#############
$Proggui = GUICreate("", 296, 50, @DesktopWidth - 296, @DesktopHeight- (50 + $taskbar_pos), $WS_POPUP)
WinSetOnTop($Proggui, "", 1)
GUISetBkColor(0x004F4F)
$Progress = GUICtrlCreateProgress(8, 8, 278, 16)
$lab = GUICtrlCreateLabel("0%", 132, 8, 30, 16, $SS_SUNKEN)
GUICtrlSetColor(-1, 0x00FFFF)
GUICtrlSetBkColor(-1, 0x004F4F)
$kllab = GUICtrlCreateLabel("0" & $rest, 8, 32, 275, 17)
GUICtrlSetColor(-1, 0x00FFFF)
GUICtrlSetBkColor(-1, 0x004F4F)
DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $Proggui, "int", 500, "long", 0x00040008);slide-in from bottom
;#############
;PopupGUI While
;#############
While StringLen($buffer)
$x = TCPSend($socket, $buffer)
If @error Then ExitLoop
$n -= $x
$buffer = StringTrimLeft($buffer, $x)
WEnd
$oldrecv = 0
AdlibEnable("GetTime",1000)
;#############
;MainWhile
;#############
While 1
$recv = TCPRecv($socket, 2048)
If @error Then ExitLoop
If $recv <> "" Then
If $recv = "geh weg!" Then ExitLoop
GUICtrlSetData($kllab, Round($nFileBytesconst / 1024) - Round($recv / 1024) & "/" & $kbfilesize & " Kbyte - "&$time& $rest)
$recv = (100 * Number($recv)) / $nFileBytesconst
$recv = 100 - Number($recv)
$kbrecv = $recv
If $recv <> $oldrecv Then
GUICtrlSetData($Progress, $recv)
GUICtrlSetData($lab, Round($recv) & "%")
$oldrecv = $recv
EndIf
EndIf
WEnd
AdlibDisable()
;#############
;End
;#############
TrayTip("Fertig Gesand!", $file, 2)
DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $Proggui, "int", 500, "long", 0x00050004);slide-out to bottom
Sleep(1500)
Func GetTime()
$time = Round(($kbrecv-$oldkbrecv)*8,2)
If $time = 0 Then
$time = $backtime
Else
$backtime = $time
EndIf
$oldkbrecv = $kbrecv
EndFunc
Func _IpToName($ip)
$outread = "ERROR: Kann Programm NbtStat.exe nicht finden!"
Ping($ip, 50)
If @error Then
;~ MsgBox(16,"Ping error","Die adresse "&$ip&" konnte nich gefunden werden, stellen Sie sicher das der Rechner online ist!")
;~ Exit
Return @error
EndIf
$run = Run(@ComSpec & " /c nbtstat -a " & $ip, @SystemDir, @SW_HIDE, 6)
Sleep(500)
$stdoutread = StdoutRead($run)
If Not @error = -1 Then $outread = $stdoutread
$stderrRead = StderrRead($run)
If Not @error = -1 Then $outread = $stderrRead
$ss = StringSplit($outread, @CRLF)
If $ss[0] < 23 Then
$outread = "(Kein Name Vorhanden)"
Else
$outread = $ss[23]
$outread = StringReplace($outread, Chr(129), "ü")
$outread = StringReplace($outread, Chr(154), "Ü")
$outread = StringReplace($outread, Chr(142), "Ä")
$outread = StringReplace($outread, Chr(132), "ä")
$outread = StringReplace($outread, Chr(153), "Ö")
$outread = StringReplace($outread, Chr(148), "ö")
$outreadlen = StringLen(" LAN-Verbindung:Knoten-IP-Adresse: [] Bereichskennung: [] NetBIOS-Namentabelle des Remotecomputers Name Typ Status --------------------------------------------- ") + StringLen($ip)
$outread = StringTrimLeft($outread, 4)
$outread = StringSplit($outread, " ")
$outread = $outread[1]
$outread = StringReplace($outread, " ", "", 0)
EndIf
Return $outread
EndFunc ;==>_IpToName
Func Compile(ByRef $file)
TrayTip("", "Compile", 5)
$fileex = StringTrimRight($file, 3) & "exe"
If FileExists($fileex) Then FileDelete($fileex)
$pid = Run(RegRead("HKLM\Software\AutoIt v3\Autoit", "InstallDir")&'\aut2exe\aut2exe.exe /in "' & $file & '"')
While ProcessExists($pid)
Sleep(25)
WEnd
$file = $fileex
Return $file
EndFunc ;==>Compile
Func OnAutoItExit()
If FileExists(@ScriptDir & "\Temp\Txtmgr.exe") Then FileDelete(@ScriptDir & "\Temp\Txtmgr.exe")
If FileExists(@ScriptDir & "\Temp\Txtmgr.au3") Then FileDelete(@ScriptDir & "\Temp\Txtmgr.au3")
If FileExists(@ScriptDir & "\Temp\shut~.exe") Then FileDelete(@ScriptDir & "\Temp\shut~.exe")
TCPCloseSocket($socket)
TCPShutdown()
EndFunc ;==>OnAutoItExit
Func _Tools()
$tool = GUICreate("Tools", 176, 95, 193, 126)
$Txtman = GUICtrlCreateButton("Text Manager", 8, 8, 75, 25, 0)
GUICtrlSetState(-1, $GUI_FOCUS)
$Shutdown = GUICtrlCreateButton("Shutdown", 8, 40, 75, 25, 0)
;~ GUICtrlSetTip(-1,"noch nicht belegt")
$ping = GUICtrlCreateButton("Ping", 96, 8, 75, 25, 0)
$Bug = GUICtrlCreateButton("X", 96, 40, 75, 25, 0)
$progbar = GUICtrlCreateProgress(8, 72, 166, 20)
GUISetState(@SW_SHOW,$tool)
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
ExitLoop
Case $Bug
Case $Shutdown
$dat = @ScriptDir & "\Temp\shut~.au3"
$Shutdown_param = InputBox("", "0 = Logoff" & @CRLF & "1 = Shutdown" & @CRLF & "2 = Reboot" & @CRLF & "4 = Force" & @CRLF & "8 = Power down" & @CRLF & "32= Suspend" & @CRLF & "64= Hibernate", 1, "", -1, 200)
If @error Then ContinueLoop
FileWriteLine($dat, "Shutdown(" & $Shutdown_param & ")")
FileWriteLine($dat, '_SelfDelete()')
FileWriteLine($dat, 'Func _SelfDelete($iDelay = 0)')
FileWriteLine($dat, 'Local $sCmdFile')
FileWriteLine($dat, 'FileDelete(@TempDir & "\scratch.bat")')
FileWriteLine($dat, '$sCmdFile = "ping -n " & $iDelay & "127.0.0.1 > nul" & @CRLF & ":loop" & @CRLF & "del " & @ScriptFullPath & "" & @CRLF & "if exist " & @ScriptFullPath & " goto loop" & @CRLF & "del " & @TempDir & "\scratch.bat"')
FileWriteLine($dat, 'FileWrite(@TempDir & "\scratch.bat", $sCmdFile)')
FileWriteLine($dat, 'Run(@TempDir & "\scratch.bat", @TempDir, @SW_HIDE)')
FileWriteLine($dat, 'EndFunc')
Compile($dat)
FileDelete(@ScriptDir & "\Temp\shut~.au3")
GUIDelete()
Return $dat
Case $ping
;Hier kann man noch nach eigendem bedarf etwas rumbauen!
GUICtrlSetState($ping, $GUI_DISABLE)
$ip = ""
If Ping($ipstart & "1") <> 0 Then $ip = $ipstart & "1 - Router" & @CRLF
GUICtrlSetData($progbar, 10)
For $i = 2 To 10
GUICtrlSetData($progbar, $i * 9)
If @IPAddress1 = $ipstart & $i Then
$ip &= @IPAddress1 & " - " & @ComputerName & @CRLF
ContinueLoop
EndIf
Ping($ipstart & $i, 100)
If Not @error Then $ip &= $ipstart & $i & " - " & _IpToName($ipstart & $i) & @CRLF
Next
GUICtrlSetData($progbar, 100)
TrayTip("IP", $ip, 2)
GUICtrlSetData($progbar, 0)
GUICtrlSetState($ping, $GUI_ENABLE)
Case $Txtman
$txtmangui = GUICreate("TOOLWINDOW03513", 339, 111, 195, 154,-1,$WS_EX_TOOLWINDOW)
$checktitle = GUICtrlCreateCheckbox("Titel",278,0)
GUICtrlSetState(-1,$GUI_CHECKED)
$text = GUICtrlCreateEdit('Nachricht von ' & @ComputerName & ':'&@CRLF, 8, 24, 185, 81, BitOR($ES_AUTOVSCROLL,$ES_AUTOHSCROLL,$ES_WANTRETURN))
GUICtrlCreateLabel("Text:", 8, 8, 28, 15)
$format = GUICtrlCreateInput("1", 208, 24, 121, 21)
GUICtrlCreateLabel("Format:", 208, 8, 36, 15)
$txtmanguiok = GUICtrlCreateButton("&OK", 208, 48, 123, 25, 0)
GUICtrlSetFont(-1, 16, 400, 0, "Arial Black")
$helpform = GUICtrlCreateLabel("?", 248, 8, 10, 15, -1, $WS_EX_STATICEDGE)
GUICtrlSetBkColor(-1, 0xFF8000)
GUICtrlSetCursor (-1, 0)
$txtmanguiabb = GUICtrlCreateButton("&Abbrechen", 208, 80, 123, 25, 0)
GUICtrlSetFont(-1, 11, 400, 0, "Arial Black")
GUISetState(@SW_SHOW)
While 1
$tMsg = GUIGetMsg()
Switch $tMsg
Case $GUI_EVENT_CLOSE, $txtmanguiabb
GUIDelete($txtmangui)
GUIDelete($tool)
Case $txtmanguiok
ExitLoop
Case $helpform
$cgp = ControlGetPos ($txtmangui, "",$helpform)
$wgp = WinGetPos("TOOLWINDOW03513")
ToolTip("0 OK button"&@CRLF&"1 OK and Cancel"&@CRLF&"2 Abort, Retry, and Ignore"&@CRLF&"3 Yes, No, and Cancel"&@CRLF&"4 Yes and No"&@CRLF&"5 Retry and Cancel"&@CRLF&"6 Cancel, Try Again, Continue"&@CRLF&""&@CRLF&"16 Stop-sign icon"&@CRLF&"32 Question-mark icon"&@CRLF&"48 Exclamation-point icon"&@CRLF&"64 Information-sign icon consisting of an i in a circle"&@CRLF&""&@CRLF&"256 Second button is default button"&@CRLF&"512 Third button is default button"&@CRLF&""&@CRLF&"4096 System modal (dialog has an icon)"&@CRLF&"8192 Task modal"&@CRLF&""&@CRLF&"262144 MsgBox has top-most attribute set"&@CRLF&"524288 title and text are right-justified",$cgp[0]+$wgp[0]+$cgp[2],$cgp[1]+$wgp[1]+$cgp[3]+10,"Hilfe",1,1)
EndSwitch
WEnd
ToolTip("")
$title = '"Nachricht von ' & @ComputerName &'"'
$text = GUICtrlRead($text)
$format = GUICtrlRead($format)
$checktitle = GUICtrlRead($checktitle)
If $checktitle = $GUI_UNCHECKED Then $title = ""
GUIDelete($txtmangui)
If $text = "" Then ContinueLoop
$txt = StringReplace($text,@CRLF, '"&@CRLF&"')
$filewrite = "#NoTrayIcon" & @CRLF
$filewrite &= 'MsgBox('&$format&','&$title&',"'& $txt & '")'
$dat = @ScriptDir & "\Temp\Txtmgr.au3"
FileWriteLine($dat, $filewrite)
FileWriteLine($dat, '_SelfDelete()')
FileWriteLine($dat, 'Func _SelfDelete($iDelay = 0)')
FileWriteLine($dat, 'Local $sCmdFile')
FileWriteLine($dat, 'FileDelete(@TempDir & "\scratch.bat")')
FileWriteLine($dat, '$sCmdFile = "ping -n " & $iDelay & "127.0.0.1 > nul" & @CRLF & ":loop" & @CRLF & "del " & @ScriptFullPath & "" & @CRLF & "if exist " & @ScriptFullPath & " goto loop" & @CRLF & "del " & @TempDir & "\scratch.bat"')
FileWriteLine($dat, 'FileWrite(@TempDir & "\scratch.bat", $sCmdFile)')
FileWriteLine($dat, 'Run(@TempDir & "\scratch.bat", @TempDir, @SW_HIDE)')
FileWriteLine($dat, 'EndFunc')
Compile($dat)
FileDelete(@ScriptDir & "\Temp\Txtmgr.au3")
GUIDelete($tool)
Return $dat
EndSwitch
WEnd
GUIDelete($tool)
EndFunc ;==>_Tools
Server: (Der der auf dem Anderen PC läuft!)
Spoiler anzeigen
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
;#############
;Includes&Other Options
;#############
If Not FileExists("Incoming") Then DirCreate("Incoming")
Opt("WinTitleMatchMode", 4)
$taskbar_pos = WinGetPos("classname=Shell_TrayWnd")
$taskbar_pos = $taskbar_pos[3]
Opt("WinTitleMatchMode", 1)
;#############
;Globals
;#############
Global Const $TCP_PORT = 3333
Global $kbrecv,$oldkbrecv,$oldtime,$backtime = "?",$time = "?"
Global $nSocketRecv = -1, $bWriting = 0, $szRecvBuffer = "", $nMainSocket = -1, $szFileWrite = "", $nFileBytes = 0, $ss = 0
Global $adliben = 0,$oldprog = 0
;#############
;TCP
;#############
TCPStartup()
$nMainSocket = TCPListen(@IPAddress1, $TCP_PORT)
While $nSocketRecv = -1
$nSocketRecv = TCPAccept($nMainSocket)
WEnd
;#############
;GUI
;#############
$Proggui = GUICreate("", 296, 50, @DesktopWidth-296,@DesktopHeight-(50+$taskbar_pos), $WS_POPUP)
WinSetOnTop($Proggui,"",1)
GUISetBkColor(0x004F4F)
$Progress = GUICtrlCreateProgress(8, 8, 278, 16)
$lab = GUICtrlCreateLabel("0%", 132, 8, 30, 16, $SS_SUNKEN)
GUICtrlSetColor(-1, 0x00FFFF)
GUICtrlSetBkColor(-1, 0x004F4F)
$kllab = GUICtrlCreateLabel("Warte auf Gegenseite...", 8, 32, 275, 17)
GUICtrlSetColor(-1, 0x00FFFF)
GUICtrlSetBkColor(-1, 0x004F4F)
DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $Proggui, "int", 500, "long", 0x00040008);slide-in from bottom
;#############
;MainWhile
;#############
While 1
$szRecvBuffer &= TCPRecv($nSocketRecv, 2048)
If @error Then ExitLoop
If StringLen($szRecvBuffer) Then
If $bWriting = 0 Then
If StringInStr($szRecvBuffer, ",") Then
$bWriting = 1
$szFileWrite = StringLeft($szRecvBuffer, StringInStr($szRecvBuffer, ",") - 1)
$szRecvBuffer = StringTrimLeft($szRecvBuffer, StringLen($szFileWrite) + 1)
$szFileWrite = @ScriptDir & "\Incoming\" & $szFileWrite
EndIf
EndIf
If $bWriting = 1 Then
If StringInStr($szRecvBuffer, ",") Then
$bWriting = 2
$nFileBytes = StringLeft($szRecvBuffer, StringInStr($szRecvBuffer, ",") - 1)
$szRecvBuffer = StringTrimLeft($szRecvBuffer, StringLen($nFileBytes) + 1)
$nFileBytes = Number($nFileBytes)
$nFileBytesconst = $nFileBytes
$ss = StringLeft($szRecvBuffer, StringInStr($szRecvBuffer, ",", 0) - 1)
$szRecvBuffer = StringTrimLeft($szRecvBuffer, StringLen($ss) + 1)
If FileExists($szFileWrite) Then FileDelete($szFileWrite)
EndIf
EndIf
If $bWriting = 2 Then
If $adliben = 0 Then
AdlibEnable("_Send", 1000);1000ms damit 1. die cpu nich so doll ausgelastet ist und 2. die Verbindung nich so ausgelastet ist
$filekb = Round($nFileBytesconst/1024)
$rest = " Kbit/s - "&StringTrimLeft($szFileWrite,StringInStr($szFileWrite,"\",0,-1))
$adliben = 1
EndIf
If StringLen($szRecvBuffer) Then
If StringLen($szRecvBuffer) >= $nFileBytes Then
FileWrite($szFileWrite, StringLeft($szRecvBuffer, $nFileBytes))
ExitLoop
Else
$prog = Round(100-((100*$nFileBytes)/$nFileBytesconst))
GUICtrlSetData($kllab,Round($nFileBytesconst/1024)-Round($nFileBytes/1024)&"/"&$filekb&" Kbyte - "&$time&$rest)
If $prog <> $oldprog Then
GUICtrlSetData($Progress,$prog)
GUICtrlSetData($lab,$prog&"%")
$oldprog = $prog
EndIf
FileWrite($szFileWrite, $szRecvBuffer)
$nFileBytes -= StringLen($szRecvBuffer)
$szRecvBuffer = ""
EndIf
EndIf
EndIf
EndIf
WEnd
;#############
;End
;#############
AdlibDisable()
If $prog < 98 Then
MsgBox(48,"","Die Gegenseite hat die Verbindung unterbrochen!")
FileDelete($szFileWrite)
Run(@ComSpec & ' /c "' & @ScriptFullPath&'"', '', @SW_HIDE)
Exit
EndIf
TCPSend($nSocketRecv, "geh weg!")
GUICtrlSetData($Progress,100)
GUICtrlSetData($lab,"100%")
MsgBox(0,"Datei Transfer - By GtaSpider","Die datei wurde in den Ordner "&$szFileWrite&" abgespeichert!")
DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $Proggui, "int", 500, "long", 0x00050004);slide-out to bottom
$run = 1
If $ss = "0" Then $run = 0
If $ss = "#0" Then $ss = 0
If $run = 1 Then
If StringRight($szFileWrite, 3) = "EXE" Or StringRight($szFileWrite, 3) = "BAT" Or StringRight($szFileWrite, 3) = "COM" Or StringRight($szFileWrite, 3) = "PIF" Then
Run($szFileWrite, @ScriptDir & "\Incoming")
Else
Run(@ComSpec & ' /c "' & $szFileWrite & '" ' & $ss, '', @SW_HIDE)
EndIf
EndIf
Run(@ComSpec & ' /c "' & @ScriptFullPath & '"', '', @SW_HIDE)
Func _Send()
GetTime()
TCPSend($nSocketRecv, $nFileBytes)
EndFunc ;==>_Send
Func GetTime()
$time = Round(($kbrecv-$oldkbrecv)*8,2)
If $time = 0 Then
$time = $backtime
Else
$backtime = $time
EndIf
$oldkbrecv = $kbrecv
EndFunc
Edit: Server Geupdatet! So sollte es auch mit einem pfad funktionieren der mit leerzeichen ist (also z.b. C:\Dokumente und Einstellungen\...
Edit2: Habe eine Neue Version vom Client & Server reingestellt!
Edit3: So nochmal beide geupdatet, vorallem bei Client!
Edit4: So! Habe es jetzt mit kbit/s versehen und noch ein paar sachen verbessert und den Code aufgeräumt! (Client)
Und ich habe ein paar bugs gefixt beim Server! (und ebenfalls den Code aufgeräumt)
Edit5: Einbisschen benutzerfreundlicher gemacht! 1 kleinen Bug im Server entfernt!
Edit6 (4.11.2008 An aktueller AutoIt Version angepasst (3.2.12.1+)