#include <ComboConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
;服務端7730 接收客戶機請求信息
$ini = @ScriptDir&("\ini.ini")
IniWrite($ini,"配置","服務器ip",@IPAddress1)
#Region ### START Koda GUI section ### Form=D:\desktop\Form1.kxf
$Form1 = GUICreate("未知程序--服務端 CopyRight by aft52577 QQ:88922678", 633, 454, 192, 114)
$mess=GUICtrlCreateEdit("", 24, 40, 289, 361)
GUICtrlCreateInput("", 328, 168, 161, 21)
$Combo=GUICtrlCreateCombo("", 336, 248, 121, 25)
GUICtrlSetData(-1, "G|H|I|J|K|L|M|N|O|P|Q|R|S|T|W|U|V|X|Y|Z|", "Z")
$Label1 = GUICtrlCreateLabel("服務器***享路徑", 344, 136, 88, 17)
$Button1 = GUICtrlCreateButton("瀏覽", 512, 168, 67, 25, 0)
$Buttonpf = GUICtrlCreateButton("客戶機映射盤符", 504, 248, 88, 25,0)
$dlname = GUICtrlCreateInput("", 336, 312, 121, 21) ;登陸名
$dlpassword=GUICtrlCreateInput("", 336, 376, 121, 21);登陸密碼
$Button2 = GUICtrlCreateButton("客戶機登陸名", 504, 312, 91, 25, 0)
$Button3 = GUICtrlCreateButton("客戶機登陸密碼", 504, 368, 91, 25, 0)
$Button4 = GUICtrlCreateButton("啟動服務", 328, 64, 123, 25, 0)
$Button5 = GUICtrlCreateButton("啟動***享", 480, 64, 123, 25, 0)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
UDPStartup()
$socket = UDPBind(@IPAddress1, 7730) ;接收客戶機請求
;~ $socket3 = UDPBind(@IPAddress1, 7733) ;接收客戶機請求
While 1
$data = UDPRecv($socket, 500)
;~ $data3 = UDPRecv($socket3, 500)
If $data <> "" Then
GUICtrlSetData($mess,"收到客戶要請求信息"&$data & @CRLF & guictrlread($mess) )
;輸出請求信息, callserver,Ip在址 處理這些符
$cliip = StringSplit($data,",")
;~ GUICtrlSetData($mess,"客戶機IP地址是"&$cliip[2] & @CRLF & guictrlread($mess) )
;~ For $endip = 1 to 254
UDPStartUp()
$socketaa=UDPOpen($cliip[2], 7731 )
$status = UDPSend($socketaa,@IPAddress1) ;發送服務器IP通知客戶端
GUICtrlSetData($mess,"向客戶機"&$cliip[2]&"發送本服務器信息"&@IPAddress1&" "&@HOUR&"時"&@MIN&"分"&@SEC&"秒"& @CRLF & guictrlread($mess) )
EndIf
$msg = GuiGetMsg()
Select
Case $msg = $GUI_EVENT_CLOSE
exit
Case $msg = $Button5
;~ SERVERRecv()
Case $msg = $Buttonpf
$pf=GUICtrlRead($Combo)
IniWrite($ini,"配置","客戶機盤符",$pf)
Case $msg = $Button2
$name=GUICtrlRead($dlname)
IniWrite($ini,"配置","登陸用戶名",$name)
Case $msg = $Button3
$password=GUICtrlRead($dlpassword)
IniWrite($ini,"配置","登陸密碼",$password)
EndSelect
WEnd
;-----------------------------------------
ini 配置文件
[配置]
服務器ip=
***享文件夾=
登陸用戶名=
登陸密碼=
客戶機盤符=