Chat im LAN -- Nachricht an alle Server senden

  • Hallo,
    nochmaliger Post:

    Ich will ein Chat Programm das alle PC's / Server im LAN erkennt, und an alle (nacheinander) die gleiche Mitteilung sendet.
    Hab dazu auch schon Hilfe aus dem Forum bekommen, bin aber leider trotzdem nicht weiter. ?( :cursing:

    Stand aktuell:
    ping an alle PC's funktioniert
    kann jedoch keine Nachricht senden ->> _senden func wird nicht gestartet

    Könnt ihr mir bitte nochmal weiter helfen und einen Blick auf das client - script werfen ! ;( :thumbup:

    server
    [autoit]

    #include <EditConstants.au3>
    #include <GUIConstantsEx.au3>
    #include <GuiEdit.au3>
    ;Opt("TrayMenuMode", 1)

    [/autoit] [autoit][/autoit] [autoit]

    Global $sNamen
    Dim $ConnectedSocket[999999]
    Dim $Namen[999999]
    $Fenster = False
    $zahl = -1
    $zahl1 = $zahl + 1
    $File = @ScriptDir & "\Server.ini"
    FileDelete($File)

    [/autoit] [autoit][/autoit] [autoit]

    HotKeySet("{ESC}", "Terminate")
    HotKeySet("!{n}", "_Fenster") ; alt + n

    [/autoit] [autoit][/autoit] [autoit]

    #Region ### START Koda GUI section ### Form=
    $Form2 = GUICreate("Serververlauf", 500, 201, 303, 219) ;GUICreate ( "title" [, width [, height [, left [, top [, style [, exStyle [, parent]]]]]]] )
    $Edit1 = GUICtrlCreateEdit("", 3, 3, 498, 196, $ES_READONLY + $ES_AUTOHSCROLL) ;GUICtrlCreateEdit ( "text", left, top [, width [, height [, style [, exStyle]]]] )
    GUICtrlSetBkColor(-1, 0xFFFFFF)

    [/autoit] [autoit][/autoit] [autoit]

    #EndRegion ### END Koda GUI section ###

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    ; Startet den TCP Service
    ;==============================================
    TCPStartup()

    [/autoit] [autoit][/autoit] [autoit]

    ; Erstellt einen lauschenden "SOCKET"
    ;==============================================
    $MainSocket = TCPListen(@IPAddress1, 31758)
    If $MainSocket > -1 Then
    MsgBox(0, "", "Die Server-Ip ist: " & @IPAddress1)
    ClipPut(@IPAddress1)
    EndIf
    If $MainSocket = -1 Then
    $MainSocket = TCPListen(@IPAddress2, 31758)
    If $MainSocket > -1 Then
    MsgBox(0, "", "Die Server-Ip ist: " & @IPAddress2)
    EndIf
    EndIf
    If $MainSocket = -1 Then
    $MainSocket = TCPListen(@IPAddress3, 31758)
    If $MainSocket > -1 Then
    MsgBox(0, "", "Die Server-Ip ist: " & @IPAddress3)
    EndIf
    EndIf
    If $MainSocket = -1 Then
    $MainSocket = TCPListen(@IPAddress4, 31758)
    If $MainSocket > -1 Then
    MsgBox(0, "", "Die Server-Ip ist: " & @IPAddress4)
    EndIf
    EndIf
    If $MainSocket = -1 Then Exit MsgBox(16, "Error", "Es ist ein Verbindungsfehler aufgetreten!")

    [/autoit] [autoit][/autoit] [autoit]

    ; Warten auf eine Client-Verbindung
    ;--------------------

    [/autoit] [autoit][/autoit] [autoit]

    While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    GUISetState(@SW_HIDE)
    EndSwitch
    $ConnectedSocket[$zahl1] = TCPAccept($MainSocket)
    If $ConnectedSocket[$zahl1] >= 0 Then
    $zahl = $zahl + 1
    $zahl1 = $zahl + 1
    ;~ MsgBox(0, "", "Mein Server - Client verbunden", 1)
    $Erhalten = TCPRecv($ConnectedSocket[$zahl], 2048)
    $sErhalten = StringSplit($Erhalten, ",")
    If $sErhalten[1] = "Name" Then
    $Namen[$zahl] = $sErhalten[2]
    ElseIf $sErhalten[1] = "NamenSenden" Then
    $zahl = $zahl - 1
    For $E = 0 To $sErhalten[2]
    $E1 = $E + 3
    $Namen[$E] = $sErhalten[$E1]
    Next
    $Status = False
    For $F = 0 To $sErhalten[2]
    $F1 = $sErhalten[2] + 1
    $F2 = $F - 1
    If $F = $sErhalten[$F1] Then $Status = True
    If $Status = True Then
    $ConnectedSocket[$F] = $ConnectedSocket[$F2]
    EndIf
    Next
    EndIf
    $sNamen = ""
    For $B = 0 To $zahl
    $sNamen = $sNamen & $Namen[$B] & "|"
    Next
    For $C = 0 To $zahl
    TCPSend($ConnectedSocket[$C], "Namen|" & $zahl & "|" & $sNamen)
    Next
    EndIf
    For $A = 0 To $zahl
    $Erhalten = TCPRecv($ConnectedSocket[$A], 9999)
    $sErhalten = StringSplit($Erhalten, ",")
    If $Erhalten <> "" Then
    $Edit1Read = GUICtrlRead($Edit1)
    GUICtrlSetData($Edit1, $Edit1Read & @CRLF & $Erhalten)
    $Lines = _GUICtrlEdit_GetLineCount($Edit1)
    _GUICtrlEdit_LineScroll($Edit1, 0, $Lines)
    For $D = 0 To $zahl
    If $sErhalten[1] = "Name" Then
    $Namen[$zahl] = $sErhalten[2]
    ElseIf $sErhalten[1] = "Nachricht" Then
    MsgBox(0, "", $Namen[$D] & "," & $sErhalten[3])
    If $Namen[$D] = $sErhalten[3] Then
    TCPSend($ConnectedSocket[$D], $Erhalten)
    EndIf
    EndIf
    Next
    ; wenn meldung gesendet, fenster anzeigen
    GUISetState(@SW_SHOW)

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    EndIf
    Next
    WEnd

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    Func Terminate()
    Exit 0
    EndFunc ;==>Terminate

    [/autoit] [autoit][/autoit] [autoit]

    Func _Fenster()
    If $Fenster = True Then
    GUISetState(@SW_HIDE)
    ElseIf $Fenster = False Then
    GUISetState(@SW_SHOW)
    EndIf
    EndFunc ;==>_Fenster

    [/autoit]
    client
    [autoit]

    #include <GUIConstants.au3>
    #include <array.au3>
    #include <_PingAll.au3>
    #include <INet.au3>
    #include <ArrayMore.au3>
    ;$IP = @IPAddress1
    ;MsgBox ("","","Die Server-Ip ist: " & $IP )
    ClipPut(@IPAddress1)
    $aPingAll = _PingAll(20, 50, "", "", "", "", "", 0, 0, 0, 0, 0, 5, " ", "1", "0", 0, 0)
    ;_PingAll($ipstart, $ipend, $iprange = "", $port01 = "", $port02 = "", $port03 = "", $port04 = "",
    ;$radim = 0, $winxp = 1, $vnc = 1, $ShowName = 1, $ShowMac = 1, $dealy = 100, $slash = "|", $yes = 1, $no = 0, $showprog = 1, $showbevore = 1)
    _Array2DEmptyDel($aPingAll, 0) ;_Array2DEmptyDel(ByRef $avArray [, $Col=0])
    _ArrayDelete($aPingAll, 0); Erstes Element aus dem Array löschen
    $sUbound = (UBound($aPingAll) - 1)
    If $aPingAll[$sUbound] = "" Then _ArrayDelete($aPingAll, ($sUbound))
    _ArrayDisplay($aPingAll, "ipadress gesamt")

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    For $x = 0 To UBound($aPingAll) - 1 ;
    $IP = $aPingAll[$x]
    MsgBox("", "$IP", $IP)
    Next
    For $z = 0 To UBound($IP) - 1

    [/autoit] [autoit][/autoit] [autoit]

    $Port = 31758
    $ConnectedSocket = TCPConnect($IP, $Port)
    If $ConnectedSocket = -1 Then
    MsgBox(16, "Error", "Es ist bei dem Verbindungsversuch ein Fehler aufgetreten, vermutlich ist kein Server gestartet!")
    Exit
    Else
    MsgBox("", "Erfolg", "$ConnectedSocket: " & $ConnectedSocket)
    EndIf

    [/autoit] [autoit][/autoit] [autoit]

    Call("_Senden")
    ;HotKeySet("^s", "_Senden") ; ctrg + s
    While 1
    $Empfang = TCPRecv($ConnectedSocket, 9999)
    If $Empfang <> "" Then
    MsgBox(0, "Nachricht", $Empfang)
    EndIf
    Sleep(500)
    WEnd
    Next

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    Func _Senden()
    $Nachricht = InputBox("Nachricht senden Client", "Schreibe deine Nachricht")
    If $Nachricht <> "" Then
    TCPSend($ConnectedSocket, $Nachricht)
    EndIf
    EndFunc ;==>_Senden

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit][/autoit] [autoit][/autoit] [autoit][/autoit]
    _PingAll.au3
    [autoit]

    #include <GUIConstants.au3>
    #include <array.au3>
    #include <_PingAll.au3>
    #include <INet.au3>
    #include <ArrayMore.au3>
    ;$IP = @IPAddress1
    ;MsgBox ("","","Die Server-Ip ist: " & $IP )
    ClipPut(@IPAddress1)
    $aPingAll = _PingAll(20, 50, "", "", "", "", "", 0, 0, 0, 0, 0, 5, " ", "1", "0", 0, 0)
    ;_PingAll($ipstart, $ipend, $iprange = "", $port01 = "", $port02 = "", $port03 = "", $port04 = "",
    ;$radim = 0, $winxp = 1, $vnc = 1, $ShowName = 1, $ShowMac = 1, $dealy = 100, $slash = "|", $yes = 1, $no = 0, $showprog = 1, $showbevore = 1)
    _Array2DEmptyDel($aPingAll, 0) ;_Array2DEmptyDel(ByRef $avArray [, $Col=0])
    _ArrayDelete($aPingAll, 0); Erstes Element aus dem Array löschen
    $sUbound = (UBound($aPingAll) - 1)
    If $aPingAll[$sUbound] = "" Then _ArrayDelete($aPingAll, ($sUbound))
    _ArrayDisplay($aPingAll, "ipadress gesamt")

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    For $x = 0 To UBound($aPingAll) - 1 ;
    $IP = $aPingAll[$x]
    MsgBox("", "$IP", $IP)
    Next
    For $z = 0 To UBound($IP) - 1

    [/autoit] [autoit][/autoit] [autoit]

    $Port = 31758
    $ConnectedSocket = TCPConnect($IP, $Port)
    If $ConnectedSocket = -1 Then
    MsgBox(16, "Error", "Es ist bei dem Verbindungsversuch ein Fehler aufgetreten, vermutlich ist kein Server gestartet!")
    Exit
    Else
    MsgBox("", "Erfolg", "$ConnectedSocket: " & $ConnectedSocket)
    EndIf

    [/autoit] [autoit][/autoit] [autoit]

    Call("_Senden")
    ;HotKeySet("^s", "_Senden") ; ctrg + s
    While 1
    $Empfang = TCPRecv($ConnectedSocket, 9999)
    If $Empfang <> "" Then
    MsgBox(0, "Nachricht", $Empfang)
    EndIf
    Sleep(500)
    WEnd
    Next

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    Func _Senden()
    $Nachricht = InputBox("Nachricht senden Client", "Schreibe deine Nachricht")
    If $Nachricht <> "" Then
    TCPSend($ConnectedSocket, $Nachricht)
    EndIf

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    EndFunc ;==>_Senden

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit][/autoit] [autoit][/autoit] [autoit][/autoit]
  • ja versuch ich

    hab aber am anfang fer for-schleife (linie 25) ne msgbox eingebaut und die wird nicht geöffnet !!!!! ;( ?( :cursing:

  • ---danke---

    ok wie kann ich das lösen ???

    das prob war das genau das in eine for - schleife muss

    oder gehts auch mit ner while schleife, aber wie????

  • ok habs jetzt so gelöst:

    Spoiler anzeigen
    Spoiler anzeigen

    #include <GUIConstants.au3>
    #include <array.au3>
    #include <_PingAll.au3>
    #include <INet.au3>
    #include <ArrayMore.au3>
    ;$IP = @IPAddress1
    ;MsgBox ("","","Die Server-Ip ist: " & $IP )
    ClipPut(@IPAddress1)
    $aPingAll = _PingAll(20, 50, "", "", "", "", "", 0, 0, 0, 0, 0, 5, " ", "1", "0", 0, 0)
    ;_PingAll($ipstart, $ipend, $iprange = "", $port01 = "", $port02 = "", $port03 = "", $port04 = "",
    ;$radim = 0, $winxp = 1, $vnc = 1, $ShowName = 1, $ShowMac = 1, $dealy = 100, $slash = "|", $yes = 1, $no = 0, $showprog = 1, $showbevore = 1)
    _Array2DEmptyDel($aPingAll, 0) ;_Array2DEmptyDel(ByRef $avArray [, $Col=0])
    _ArrayDelete($aPingAll, 0); Erstes Element aus dem Array löschen
    $sUbound = (UBound($aPingAll) - 1)
    If $aPingAll[$sUbound] = "" Then _ArrayDelete($aPingAll, ($sUbound))
    _ArrayDisplay($aPingAll, "ipadress gesamt")


    For $x = 0 To UBound($aPingAll) - 1 ;
    $IP = $aPingAll[$x]
    ;MsgBox("", "$IP", $IP)

    Next


    For $z = 0 To UBound($aPingAll) - 1

    $Port = 31758
    $ConnectedSocket = TCPConnect($IP, $Port)
    MsgBox("","Linie 25 $ConnectedSocket = ",$IP &"_"& $Port )
    If $ConnectedSocket = -1 Then
    MsgBox(16, "Error", "Es ist bei dem Verbindungsversuch ein Fehler aufgetreten, vermutlich ist kein Server gestartet!")
    Exit
    Else
    MsgBox("", "Erfolg", "$ConnectedSocket: " & $ConnectedSocket)
    EndIf

    _Senden()
    ;HotKeySet("^s", "_Senden") ; ctrg + s

    Sleep(30000)
    While 1
    $Empfang = TCPRecv($ConnectedSocket, 9999)
    If $Empfang <> "" Then
    MsgBox(0, "Nachricht", $Empfang)
    EndIf
    Sleep(500)
    WEnd
    Next


    Func _Senden()
    $Nachricht = "Nachricht test test"
    ;InputBox("Nachricht senden Client", "Schreibe deine Nachricht")
    If $Nachricht <> "" Then
    TCPSend($ConnectedSocket, $Nachricht)
    EndIf
    EndFunc ;==>_Senden

    aber eine verbindung kommt jetzt nicht zustande:
    Fehlermeldung aus Linie 34: MsgBox(16, "Error", "Es ist bei dem Verbindungsversuch ein Fehler aufgetreten, vermutlich ist kein Server gestartet!")

    hab ein test script geschrieben um die verbinfung zu testen:

    Spoiler anzeigen
    [autoit]

    $Port = 31758
    $IP = "192.168.178.36"
    $ConnectedSocket = TCPConnect($IP, $Port)

    If $ConnectedSocket = -1 Then
    MsgBox("","Fehler",@error)
    Else
    MsgBox("", "Erfolg", "$ConnectedSocket: " & $ConnectedSocket)
    EndIf

    exit

    [/autoit]

    Fehlercode @error ist : 10093
    WTF? ?(

    in der Hilfe steht nur was von
    If IPAddr is incorrect @error is set to 1.
    If port is incorrect @error is set to 2.

    hat jemand ne idee ???? (p.s. firewall ist an beiden PC's aus !!)

  • Also du hast da voll den Fehler drin!

    Spoiler anzeigen
    [autoit]

    #include <GUIConstants.au3>
    #include <array.au3>
    #include <_PingAll.au3>
    #include <INet.au3>
    #include <ArrayMore.au3>
    ;$IP = @IPAddress1
    ;MsgBox ("","","Die Server-Ip ist: " & $IP )
    ClipPut(@IPAddress1)
    $aPingAll = _PingAll(20, 50, "", "", "", "", "", 0, 0, 0, 0, 0, 5, " ", "1", "0", 0, 0)
    ;_PingAll($ipstart, $ipend, $iprange = "", $port01 = "", $port02 = "", $port03 = "", $port04 = "",
    ;$radim = 0, $winxp = 1, $vnc = 1, $ShowName = 1, $ShowMac = 1, $dealy = 100, $slash = "|", $yes = 1, $no = 0, $showprog = 1, $showbevore = 1)
    _Array2DEmptyDel($aPingAll, 0) ;_Array2DEmptyDel(ByRef $avArray [, $Col=0])
    _ArrayDelete($aPingAll, 0); Erstes Element aus dem Array löschen
    $sUbound = (UBound($aPingAll) - 1)
    If $aPingAll[$sUbound] = "" Then _ArrayDelete($aPingAll, ($sUbound))
    _ArrayDisplay($aPingAll, "ipadress gesamt")

    For $z = 0 To UBound($aPingAll) - 1

    $Port = 31758
    $ConnectedSocket = TCPConnect($aPingAl[$z], $Port)
    MsgBox("","Linie 25 $ConnectedSocket = ",$IP &"_"& $Port )
    If $ConnectedSocket = -1 Then
    MsgBox(16, "Error", "Es ist bei dem Verbindungsversuch ein Fehler aufgetreten, vermutlich ist kein Server gestartet!")
    Exit
    Else
    MsgBox("", "Erfolg", "$ConnectedSocket: " & $ConnectedSocket)
    EndIf

    _Senden()
    ;HotKeySet("^s", "_Senden") ; ctrg + s

    Sleep(30000)
    While 1
    $Empfang = TCPRecv($ConnectedSocket, 9999)
    If $Empfang <> "" Then
    MsgBox(0, "Nachricht", $Empfang)
    EndIf
    Sleep(500)
    WEnd
    Next


    Func _Senden()
    $Nachricht = "Nachricht test test"
    ;InputBox("Nachricht senden Client", "Schreibe deine Nachricht")
    If $Nachricht <> "" Then
    TCPSend($ConnectedSocket, $Nachricht)
    EndIf
    EndFunc ;==>_Senden

    [/autoit]

    Also ich hab es jetzt nicht ausprobiert, sollte aber gehen!

    EDIT:
    Ich habe auserdem die Func _PingAll nicht, oben in dem Spoiler _PingAll.au3 ist die nähmlich nicht drin!

    mfg. Jam00

  • immer noch selbes prob wie vorher -> fehlercode 10093 keine verbindung zum server

    edit: sorry

    Spoiler anzeigen
    [autoit]

    #include <GUIConstants.au3>
    #include <array.au3>

    [/autoit] [autoit][/autoit] [autoit]

    ; ##############################################################################
    ; ### PING ALL #################################################################

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    Func _PingAll($ipstart, $ipend, $iprange = "", $port01 = "", $port02 = "", $port03 = "", $port04 = "", $radim = 0, $winxp = 1, $vnc = 1, $ShowName = 1, $ShowMac = 1, $dealy = 100, $slash = "|", $yes = 1, $no = 0, $showprog = 1, $showbevore = 1)

    If $iprange = "" Then
    $iprange = StringSplit(@IPAddress1, ".")
    $iprange = $iprange[1] & "." & $iprange[2] & "." & $iprange[3] & "."
    EndIf
    Local $ipadress[$ipend + 1] = [1, ""]
    $ip = $ipstart
    If $showprog = 1 Then ProgressOn("IP", "IP Check")

    Global $ra, $xp, $VNC3, $MAC1, $name1
    If $showbevore = 1 Then
    $ra = "Ra:"
    $xp = "XP:"
    $VNC3 = "VNC:"
    $MAC1 = "Mac:"
    $name1 = "Name:"
    EndIf

    $i = 0
    Do
    If $showprog = 1 Then ProgressSet(($ip * 100) / $ipend, $iprange & $ip)
    $ip += 1
    Ping($iprange & $ip, $dealy)
    If Not @error Then
    $i += 1
    $ipadress[$i] &= $iprange & $ip & $slash
    If $port01 <> "" Then $ipadress[$i] &= $port01 & ":" & PortScan($port01, $iprange & $ip, $yes, $no) & $slash
    If $port02 <> "" Then $ipadress[$i] &= $port02 & ":" & PortScan($port02, $iprange & $ip, $yes, $no) & $slash
    If $port03 <> "" Then $ipadress[$i] &= $port03 & ":" & PortScan($port03, $iprange & $ip, $yes, $no) & $slash
    If $port04 <> "" Then $ipadress[$i] &= $port04 & ":" & PortScan($port04, $iprange & $ip, $yes, $no) & $slash
    If $radim <> 0 Then $ipadress[$i] &= $ra & PortScan(4899, $iprange & $ip, $yes, $no) & $slash
    If $winxp <> 0 Then $ipadress[$i] &= $xp & PortScan(3389, $iprange & $ip, $yes, $no) & $slash
    If $vnc <> 0 Then $ipadress[$i] &= $VNC3 & PortScan(5900, $iprange & $ip, $yes, $no) & $slash
    If $ShowMac <> 0 Then $ipadress[$i] &= $MAC1 & _GetMACFromIP($iprange & $ip) & $slash
    If $ShowName <> 0 Then $ipadress[$i] &= $name1 & _IpToName($iprange & $ip) & $slash
    EndIf
    $ipadress[$ip] = StringTrimRight($ipadress[$ip], 1)
    ; MsgBox(0,"ipstart" & $ipstart&" ipend "&$ipend,$iprange&$ip)

    If $showprog = 1 Then ProgressSet(($ip * 100) / $ipend)
    If $showprog <> 0 And $showprog <> 1 Then GUICtrlSetData($showprog, ($ip * 100) / $ipend)
    Until $ip >= $ipend
    $ipadress[0] = $i
    ProgressOff()
    ;_ArrayDisplay($ipadress, "_ArrayDisplay $ipadress")
    Return $ipadress
    EndFunc ;==>_PingAll
    ; ##############################################################################

    [/autoit] [autoit][/autoit] [autoit]

    Func PortScan($port, $ip, $1, $2)
    $socket = TCPConnect($ip, $port)
    If $socket = -1 Then
    Return $2
    Else
    Return $1
    EndIf
    EndFunc ;==>PortScan

    [/autoit] [autoit][/autoit] [autoit]

    Func _GetMACFromIP($sIP)
    Local $MAC, $MACSize
    Local $i, $s, $r, $iIP
    $MAC = DllStructCreate("byte[6]")
    $MACSize = DllStructCreate("int")
    DllStructSetData($MACSize, 1, 6)
    $r = DllCall("Ws2_32.dll", "int", "inet_addr", "str", $sIP)
    $iIP = $r[0]
    $r = DllCall("iphlpapi.dll", "int", "SendARP", "int", $iIP, "int", 0, "ptr", DllStructGetPtr($MAC), "ptr", DllStructGetPtr($MACSize))
    $s = ""
    For $i = 0 To 5
    If $i Then $s = $s & ":"
    $s = $s & Hex(DllStructGetData($MAC, 1, $i + 1), 2)
    Next
    Return $s
    EndFunc ;==>_GetMACFromIP

    [/autoit] [autoit][/autoit] [autoit]

    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

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    ; ##############################################################################
    ; ##############################################################################
    ; ##############################################################################

    [/autoit]
  • Mach mal nicht so einen Streß ja? Wir haben vileicht auch anderes zu tun als uns nur mit deinem Problem rumzuschgen!
    Wir sind hier kein Chat! Und mach vieleicht auch mal was selber!

    Troz allem hab ich mal was gemacht:

    Spoiler anzeigen
    [autoit]

    #include <GUIConstants.au3>
    #include <array.au3>
    #include "_PingAll.au3"
    #include <INet.au3>
    #include <ArrayMore.au3>
    ;$IP = @IPAddress1
    ;MsgBox ("","","Die Server-Ip ist: " & $IP )
    ClipPut(@IPAddress1)
    $aPingAll = _PingAll(20, 50, "", "", "", "", "", 0, 0, 0, 0, 0, 5, " ", "1", "0", 0, 0)
    ;_PingAll($ipstart, $ipend, $iprange = "", $port01 = "", $port02 = "", $port03 = "", $port04 = "",
    ;$radim = 0, $winxp = 1, $vnc = 1, $ShowName = 1, $ShowMac = 1, $dealy = 100, $slash = "|", $yes = 1, $no = 0, $showprog = 1, $showbevore = 1)
    _Array2DEmptyDel($aPingAll, 0) ;_Array2DEmptyDel(ByRef $avArray [, $Col=0])
    _ArrayDelete($aPingAll, 0); Erstes Element aus dem Array löschen
    $sUbound = (UBound($aPingAll) - 1)
    If $aPingAll[$sUbound] = "" Then _ArrayDelete($aPingAll, ($sUbound))
    _ArrayDisplay($aPingAll, "ipadress gesamt")
    $Ubound = UBound($aPingAll) - 1
    $Port = 31758
    $Verbidungen = ""
    $Status = False
    Dim $IpVerbunden[$Ubound]
    For $z = 0 To $Ubound

    [/autoit] [autoit][/autoit] [autoit]

    $ConnectedSocket = TCPConnect($aPingAll[$z], $Port)
    If $ConnectedSocket <> -1 Then
    $Status = True
    For $1 = 0 To $Ubound
    If $IpVerbunden[$1] <> "" Then
    $IpVerbunden[$1] = $aPingAll[$z]
    ExitLoop
    EndIf
    Next
    EndIf
    Next
    If $Status = True Then
    For $2 = 0 To $Ubound
    If $IpVerbunden[$2] <>"" Then
    $Verbidungen = $Verbidungen & @CRLF & $IpVerbunden[$2]
    EndIf
    Next
    MsgBox(64,"Verbindungen","Es konnten Verbindungen hergestellt werden mit:" & @CRLF & $Verbidungen)
    Else
    MsgBox (16,"Error","Es konnte keine Verbindung hergestellt werden!")
    EndIf
    _Senden()
    ;HotKeySet("^s", "_Senden") ; ctrg + s

    [/autoit] [autoit][/autoit] [autoit]

    Sleep(30000)
    While 1
    $Empfang = TCPRecv($ConnectedSocket, 9999)
    If $Empfang <> "" Then
    MsgBox(0, "Nachricht", $Empfang)
    EndIf
    Sleep(500)
    WEnd

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    Func _Senden()
    $Nachricht = "Nachricht test test"
    ;InputBox("Nachricht senden Client", "Schreibe deine Nachricht")
    If $Nachricht <> "" Then
    TCPSend($ConnectedSocket, $Nachricht)
    EndIf
    EndFunc ;==>_Senden

    [/autoit]

    Ich kann nicht sagen ob es geht, dabei mir die Funktion _PingAll nicht funktoniert, keine Ahnung warum nicht, aber dewegen kann ich es nicht ausprobieren!

    mfg. Jam00

  • Mach mal nicht so einen Streß ja? Wir haben vileicht auch anderes zu tun als uns nur mit deinem Problem rumzuschgen!
    Wir sind hier kein Chat! Und mach vieleicht auch mal was selber!

    Tut mir leid, ich bin halt schnellere Hilfe (zumindest aber irgendwine schnelle Antwort) gewohnt :cursing:
    Ich bin jetzt seit Freitag mit dem Thema hier schon im Forum. :cursing:

    Dieser Thread (mit immer noch dem selben Problem wie Freitag) wurde um 12:14 Uhr geöffnet, die erste Antwort kam erst nach mehr als 2 Stunden.

    soll ich weiter machen ??
    oder reicht die Begründung das ich hier "einen Streß" mach ?? X(

    trotz allem danke für deine Hilfe :rolleyes:


    EDIT: _pingAll gabs hier von Xenobiologist ,

  • Geht meins denn jetzt? Ja und, wenn wir doch auch nichst wissen, und ich kann ja auch nix Probieren da _PingAll nicht geht!

    EDIT:
    Ja ich hab die _PingAll ja, aber sie geht bei mir nicht, liegt warscheinlich dran das mein Netzwerknichichtig Registriet ist!

    mfg. Jam00

  • Autoit Error

    Linie 89 (File"C:\Programme}Autoit3\Include\ArrayMore.au3"):

    Func _ArraySort_2ary(ByRef $$ARRAY,$DIM_1ST=0, $DESCENDING=0, $REVERSE=False)

    Error: Duplicate function name.

    EDIT: die funktion wird doch gar nicht verwendet ?(

    • Offizieller Beitrag

    Wenn ich mich richtig erinnere, wird sie von _Array2DEmptyDel verwendet.

    Zitat

    die erste Antwort kam erst nach mehr als 2 Stunden.


    Ich finde das gelinde gesagt ziemlich unverschämt! Wir sind aus reiner Freude hier dabei, niemand bezahlt uns für unser Engagement!
    Ob du nach solchen Sprüchen noch weiteren Support bekommst.. X(

    • Offizieller Beitrag

    Wir sind schnell, verdammt schnell. Ich kenne kein Forum, das schneller ist.

    Aber!

    Das gibt keinem das Recht, bei zwei Stunden ohne Antwort enttäuscht zu sein und das Thema zu bumpen. Das könnt ihr machen, wenn ihr uns (angemessen) bezahlt...
    Dieser fordernde Ton nervt dann schon, also lieber auch mal in Geduld üben ;).

    peethebee