#include <Array.au3>
#include <ButtonConstants.au3>
#include <ComboConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <GuiComboBoxEx.au3>
#include <array.au3>
#include <Excel.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <Constants.au3>
$Form1 = GUICreate("Collect FIO Log Tool", 520, 230, -1, -1)
$Radio1 = GUICtrlCreateRadio("Collect 1HDD", 400, 50, 97, 25)
$Button1 = GUICtrlCreateButton("Collect Log", 400, 150, 97, 25, 0)
$hLabel1 = GUICtrlCreateLabel("BW", 30, 14, 97, 25, 0)
GUISetState(@SW_SHOW)
Local $file = FileOpenDialog("請選擇要開啟的檔案", "c:\data", " TXT(*.*) ")
$Input1 = GUICtrlCreateEdit("", 30, 30, 100, 175)
While 1
;read printer information
$sRead = BinaryToString(FileRead($file),4)
$prn000 = StringRegExp($sRead, "(\d{1,3}\.){3}\d{1,3}(:\d+)?", 4)
If Not @error Then
For $i = 0 To UBound($prn000) - 1
GUICtrlSetData($Input1, ($prn000[$i])[0] & @CRLF, 1)
Next
Sleep(5000)
EndIf
$Msg = GUIGetMsg()
Switch $Msg
Case $GUI_EVENT_CLOSE
Exit
Case $Button1
If BitAND(GUICtrlRead($Radio1), $GUI_CHECKED) = 1 Then
RunWait(@DesktopDir & "\dopdf-7.exe", "")
EndIf
EndSwitch
WEnd
|