ฟอรั่ม PSsix

Would you like to react to this message? Create an account in a few clicks or log in to continue.

ฟอรั่มของบล็อก http://pssix.blogspot.com


    การส่งและรับค่า จุดเริ่มต้นของการเขียนบอท สร้างเซิฟเวอร์ และเว็บเซิฟเวอร์

    rolovely
    rolovely
    PSsix Member Super Class II
    PSsix Member Super Class II


    PSsix Game Coder
    จำนวนข้อความ : 193
    ความนิยม : 26
    เข้าร่วมเมื่อ : 15/10/2010
    อายุ : 35
    ที่อยู่ : THAILAND

    การส่งและรับค่า จุดเริ่มต้นของการเขียนบอท สร้างเซิฟเวอร์ และเว็บเซิฟเวอร์ Empty การส่งและรับค่า จุดเริ่มต้นของการเขียนบอท สร้างเซิฟเวอร์ และเว็บเซิฟเวอร์

    ตั้งหัวข้อ by rolovely 13/08/11, 06:43 pm

    ขอยกเครดิตให้เว็บนี้ก่อนเลยละกัน เดี๋ยวโดนละเมิดลิขสิทธิ์
    Credit [You must be registered and logged in to see this link.]

    วันนี้ช่วงเย็น นั่งหาข้อมูลทั่วโลกของการเกี่ยวกับการส่งข้อมูลที่เรียกว่า packet เลยนึกการทำงานของเว็บเซิฟเวอร์ หรือโปรแกรมจำลองเซิฟเวอร์บนเครื่องพีซีที่บ้าน

    #include <ButtonConstants.au3>
    #include <EditConstants.au3>
    #include <GUIConstantsEx.au3>
    #include <StaticConstants.au3>
    #include <WindowsConstants.au3>
    #Include <GuiEdit.au3>
    #include <INet.au3>

    $internalip = @IPAddress1 ;<<<<<<<<<<<<<<ส่วนนี้ห้ามแก้นะครับ
    $externalip = _GetIP()
    $port = 32132 ;<<<<<<<<<<<<< แก้ port ตรงนี้ครับ

    $gui = GUICreate('Header Grabber' ,600,400)
    $text_internalip = GUICtrlCreateLabel("(You proxy connect to this) Internal IP: " & $internalip, 10, 5)
    $text_externalip = GUICtrlCreateLabel("(They proxy connect to this) External IP: " & $externalip, 10, 20)
    $edit = GUICtrlCreateEdit('',10,40,580,350)
    GUISetState()

    TCPStartUp()
    $MainSocket = TCPListen($internalip, $port)

    While 1
    $msg = GUIGetMsg()
    $ConnectedSocket = TCPAccept($MainSocket)
    If $msg = $GUI_EVENT_CLOSE Then close()
    If $ConnectedSocket >= 0 Then
    $recv = TCPRecv($ConnectedSocket, 2048)
    While $recv <> ''
    GUICtrlSetData($edit, GUICtrlRead($edit) & '<--- START COPY --->' & @CRLF & @CRLF & $recv & @CRLF & '<--- END COPY --->' & @CRLF & @CRLF)
    FileWrite("HGLog.txt", GUICtrlRead($edit))
    TCPSend($ConnectedSocket, '<html>')
    TCPSend($ConnectedSocket, '<head>')
    TCPSend($ConnectedSocket, '<title>Header Grabbed</title>')
    TCPSend($ConnectedSocket, '</head>')
    TCPSend($ConnectedSocket, '<body>')
    TCPSend($ConnectedSocket, '<center><strong><font size="5" color="red">ดีจ้า Edit by Rolovely <a href="http://pssix.forumotion.com">http://pssix.forumotion.com</a></font></strong></center>')
    TCPSend($ConnectedSocket, '<center><strong><font size="5" color="red">Credit <a href="http://www.autoitscript.com/forum/topic/47184-header-grabber/">http://www.autoitscript.com/forum/topic/47184-header-grabber/</a></font></strong></center>')
    TCPSend($ConnectedSocket, '<center><strong><font size="5">Thank you for your support!</font></strong></center>')
    TCPSend($ConnectedSocket, '</body>')
    TCPSend($ConnectedSocket, '</html>')
    TCPCloseSocket($ConnectedSocket)
    ExitLoop
    WEnd
    EndIf
    WEnd

    Func close()
    If $ConnectedSocket >= 0 Then TCPCloseSocket($ConnectedSocket)
    TCPShutDown()
    Exit
    EndFunc

    วิธีทดสอบนะครับ [You must be registered and logged in to see this image.]

    rolovely
    rolovely
    PSsix Member Super Class II
    PSsix Member Super Class II


    PSsix Game Coder
    จำนวนข้อความ : 193
    ความนิยม : 26
    เข้าร่วมเมื่อ : 15/10/2010
    อายุ : 35
    ที่อยู่ : THAILAND

    การส่งและรับค่า จุดเริ่มต้นของการเขียนบอท สร้างเซิฟเวอร์ และเว็บเซิฟเวอร์ Empty Re: การส่งและรับค่า จุดเริ่มต้นของการเขียนบอท สร้างเซิฟเวอร์ และเว็บเซิฟเวอร์

    ตั้งหัวข้อ by rolovely 13/08/11, 06:44 pm

    ส่วนนี้คือ การทำงาน UDP Protocol
    การทำงานใช้รับส่งไฟล์ เหมือนโปรแกรมบิท ftp เดี๋ยวจะมาลงอีกเพิ่มเติมนะครับ

    Global $hSocket, $data

    UDPStartUp()
    $hSocket = UDPOpen("ip", "port")
    $data = FileRead("getmotd")
    UDPSend($hSocket, $data)

    Global $hSocket, $data, $i = 0

    UDPStartUp()
    $hSocket = UDPOpen("63.146.124.45", "20111")
    $data = FileRead("getmotd")

    While $i < 3
    UDPSend($hSocket, $data)
    Sleep(1000)
    $i += 1
    WEnd


    แก้ไขล่าสุดโดย rolovely เมื่อ 13/08/11, 10:27 pm, ทั้งหมด 2 ครั้ง
    rolovely
    rolovely
    PSsix Member Super Class II
    PSsix Member Super Class II


    PSsix Game Coder
    จำนวนข้อความ : 193
    ความนิยม : 26
    เข้าร่วมเมื่อ : 15/10/2010
    อายุ : 35
    ที่อยู่ : THAILAND

    การส่งและรับค่า จุดเริ่มต้นของการเขียนบอท สร้างเซิฟเวอร์ และเว็บเซิฟเวอร์ Empty Re: การส่งและรับค่า จุดเริ่มต้นของการเขียนบอท สร้างเซิฟเวอร์ และเว็บเซิฟเวอร์

    ตั้งหัวข้อ by rolovely 13/08/11, 06:44 pm

    จองไว้ที่ 2

      เวลาขณะนี้ 17/05/24, 09:09 am