Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <GUIConstantsEx.au3>
- #include <WindowsConstants.au3>
- #include <StaticConstants.au3>
- #include <EditConstants.au3>
- #include <Constants.au3>
- #include <File.au3>
- #include <Array.au3>
- #include <String.au3>
- #include <FTPEx.au3>
- #include <DateTimeConstants.au3>
- #include <GDIPlus.au3>
- #include <WinAPI.au3>
- Opt("MustDeclareVars", 1) ;===> All globals have to be declared
- ;==========================================================
- ;========== Globals... what else... =======================
- ;==========================================================
- Global $filename, $path, $directory, $pic1, $WinTitle
- Global $slotname1, $slotname2, $slot, $adress
- Global $box1, $box2, $box3, $box4, $box5, $label_1, $label_2, $label_3, $label_4, $label_5, $EditText1, $EditText2, $EditText3, $EditText4, $EditText5
- Global $ConnButton, $NewButton, $ExitButton, $SaveButton, $screenButton, $SaveButton, $EditButton
- Global $font, $date, $WinMain, $DTM_SETFORMAT_, $progname, $icon, $file
- Global $string1, $string2, $string3, $string4, $string5, $chars, $chars1, $chars2
- Global $Open, $Conn, $username, $pass, $Ftpc, $Conn, $server, $ftpFile, $ftpFile1, $right, $right1
- Global $timestamp, $screendate, $Screenshot_name, $debugpath, $debugname, $trackname, $trackpath
- Global $picname, $picpath, $pmdname, $pmdpath
- Global $hGUI, $hImage, $hGraphic, $hImage1, $ping, $short_picname, $hGraphic1, $pic2, $hGraphic2
- Global $pic3, $hImage2, $hGraphics, $png_file, $screen_pic, $dummypic
- Global $group1, $group2, $group3, $edit, $hDC
- Global $radio1, $radio2, $radio3
- Global Const $STM_SETIMAGE = 0x0172
- Global $msg
- Local $style = "yyyy-MM-dd_HH-mm-ss"
- ;==========================================================
- ;======= Here we go... ====================================
- ;==========================================================
- _Main()
- Func _Main()
- ;==========================================================
- ;====== call func ebiniread to readout ini ================
- ;==========================================================
- _ebiniread()
- ;==========================================================
- ;====== set gui ===========================================
- ;==========================================================
- $WinMain = GUICreate($progname, 1200, 800, -1, -1, $WS_EX_OVERLAPPEDWINDOW)
- GUISetBkColor(0x182424) ;~ set background color
- ;======= Set JPEG on mainscreen
- $pic1 = GUICtrlCreatePic(@ScriptDir & '\EB-Grafik_oben.jpg', 15, 15, 600, 100, BitOR($SS_NOTIFY, $WS_CLIPSIBLINGS))
- $icon = GUISetIcon(@ScriptDir & '\EB.ico')
- #cs
- ;==========================================================
- ;========= set box for timestamp ==========================
- sets the box to show the timestamp. The box is disabled, because there
- is nothing to set manually.
- The included timestamp is generated by clicking the $newbutton in the GUI
- ;==========================================================
- #ce
- $date = GUICtrlCreateDate("", 1020, 60, 150, 20)
- GUICtrlSetFont($date, 10, 1000, 0, $font)
- GUICtrlSetColor(-1, 0xFAFFFF)
- GUICtrlSetState($date, $GUI_DISABLE)
- $DTM_SETFORMAT_ = 0x1032
- GUICtrlSendMsg($date, $DTM_SETFORMAT_, 0, $style)
- #cs
- ;==========================================================
- ;============ Radiobuttons ================================
- ;==========================================================
- Comment:
- the following group with radio buttons is generated to set the online- or offline version
- ;==========================================================
- #ce
- $group1 = GUICtrlCreateGroup("Settings", 680, 15, 200, 100)
- GUICtrlSetFont(-1, 11, 1000, 0, $font)
- GUICtrlSetColor(-1, 0xFFFFFF) ; weiß
- $radio1 = GUICtrlCreateRadio("Online-Modus", 710, 45, 140, 20)
- GUICtrlSetFont(-1, 11, 1000, 0, $font)
- GUICtrlSetColor(-1, 0xFFFFFF) ; weiß
- $radio2 = GUICtrlCreateRadio("Offline-Modus", 710, 75, 140, 20)
- GUICtrlSetFont(-1, 11, 1000, 0, $font)
- GUICtrlSetColor(-1, 0xFFFFFF) ; weiß
- GUICtrlCreateGroup("", -99, -99, 1, 1) ;close group
- ;==========================================================
- ;============ Generate textboxes ==========================
- ;==========================================================
- ;==========================================================
- ;========= Textbox 1 incl. label ==========================
- ;==========================================================
- ;=== Label Box1
- $label_1 = GUICtrlCreateLabel($box1, 130, 120, 200, 20, $font)
- GUICtrlSetFont($label_1, 11, 1000, 0, $font)
- GUICtrlSetColor(-1, 0xFFFFFF) ; weiß
- ;=== Textbox1
- $EditText1 = GUICtrlCreateEdit('', 130, 140, 900, 20, $ES_AUTOHSCROLL)
- GUICtrlSetFont($EditText1, 10, 1000, 0, $font)
- GUICtrlSetColor(-1, 0xFAFFFF)
- GUICtrlSetBkColor(-2, 0x000000)
- ;==========================================================
- ;========== Textbox 2 incl. label =========================
- ;==========================================================
- ;=== Label Box2
- $label_2 = GUICtrlCreateLabel($box2, 130, 170, 200, 20, $font)
- GUICtrlSetFont($label_2, 11, 1000, 0, $font)
- GUICtrlSetColor(-1, 0xFFFFFF) ; weiß
- ;=== Textbox2
- $EditText2 = GUICtrlCreateEdit('', 130, 190, 900, 150)
- GUICtrlSetFont($EditText2, 10, 1000, 0, $font)
- GUICtrlSetColor(-1, 0xFAFFFF)
- GUICtrlSetBkColor(-2, 0x000000)
- ;==========================================================
- ;=========== Textbox 3 incl. label ========================
- ;==========================================================
- ;=== Label Box3
- $label_3 = GUICtrlCreateLabel($box3, 130, 350, 200, 20, $font)
- GUICtrlSetFont($label_3, 11, 1000, 0, $font)
- GUICtrlSetColor(-1, 0xFFFFFF) ; weiß
- ;=== Textbox3
- $EditText3 = GUICtrlCreateEdit('', 130, 370, 900, 150)
- GUICtrlSetFont($EditText3, 10, 1000, 0, $font)
- GUICtrlSetColor(-1, 0xFAFFFF)
- GUICtrlSetBkColor(-2, 0x000000)
- ;==========================================================
- ;=========== Textbox 4 incl. label ========================
- ;==========================================================
- ;=== Label Box4
- $label_4 = GUICtrlCreateLabel($box4, 130, 530, 200, 20, $font)
- GUICtrlSetFont($label_4, 11, 1000, 0, $font)
- GUICtrlSetColor(-1, 0xFFFFFF) ; weiß
- ;=== Textbox3
- $EditText4 = GUICtrlCreateEdit('', 130, 550, 450, 100)
- GUICtrlSetFont($EditText4, 10, 1000, 0, $font)
- GUICtrlSetColor(-1, 0xFAFFFF)
- GUICtrlSetBkColor(-2, 0x000000)
- ;==========================================================
- ;=========== Textbox 5 incl. label ========================
- ;==========================================================
- ;=== Label Box5
- $label_5 = GUICtrlCreateLabel($box5, 130, 660, 200, 20, $font)
- GUICtrlSetFont($label_5, 11, 1000, 0, $font)
- GUICtrlSetColor(-1, 0xFFFFFF) ; weiß
- ;=== Textbox3
- $EditText5 = GUICtrlCreateEdit('', 130, 680, 450, 100)
- GUICtrlSetFont($EditText5, 10, 1000, 0, $font)
- GUICtrlSetColor(-1, 0xFAFFFF)
- GUICtrlSetBkColor(-2, 0x000000)
- ;==========================================================
- ;========= generate BUTTONS ===============================
- ;==========================================================
- $ConnButton = GUICtrlCreateButton("Connect to target", 1070, 400, 100, 60, 0, $WS_EX_CLIENTEDGE)
- GUICtrlSetState(-1, $GUI_DISABLE) ;disable button until connection established
- $ExitButton = GUICtrlCreateButton('Exit', 1070, 140, 100, 60, 0, $WS_EX_CLIENTEDGE)
- GUICtrlSetBkColor(-1, 0xCC3300)
- $NewButton = GUICtrlCreateButton("New report", 1070, 320, 100, 60, 0, $WS_EX_CLIENTEDGE)
- GUICtrlSetState(-1, $GUI_DISABLE) ;disable button until connection established
- $screenButton = GUICtrlCreateButton('Take Screenshot', 1070, 480, 100, 60, 0, $WS_EX_CLIENTEDGE)
- GUICtrlSetState(-1, $GUI_DISABLE) ;disable button until connection established
- $EditButton = GUICtrlCreateButton('Open Textfile', 1070, 560, 100, 60, 0, $WS_EX_CLIENTEDGE)
- GUICtrlSetState(-1, $GUI_DISABLE) ;disable button until Textfile is written
- $SaveButton = GUICtrlCreateButton('Save Text', 1070, 640, 100, 60, 0, $WS_EX_CLIENTEDGE)
- GUICtrlSetState(-1, $GUI_DISABLE) ;disable button until connection established
- $pic1 = GUICtrlCreatePic(@ScriptDir & '\EB-Grafik_oben.jpg', 15, 15, 600, 100, BitOR($SS_NOTIFY, $WS_CLIPSIBLINGS))
- ;==========================================================
- ;====== start GDI+ ========================================
- ;==========================================================
- ;==========================================================
- ;====== call func to set start logo to GUI ================
- ;==========================================================
- ;====== show GUI ==========================================
- ;==========================================================
- GUISetState() ; ====> show window
- ;==========================================================
- ;=============================== Events ===================
- ;==========================================================
- While 1
- Switch GUIGetMsg()
- Case $WinMain
- Case $radio1
- GUICtrlSetState($ConnButton, $GUI_ENABLE) ;enable connect button
- GUICtrlSetBkColor($ConnButton, 0xCC3300) ; set Background color
- _WinAPI_RedrawWindow($WinMain) ; redraw complete window
- Case $radio2
- GUICtrlSetState($ConnButton, $GUI_DISABLE) ;enable connect button
- GUICtrlSetBkColor($ConnButton, 0xCC3300)
- GUICtrlSetState($NewButton, $GUI_ENABLE) ;enable NEW button
- _WinAPI_RedrawWindow($WinMain)
- Case $GUI_EVENT_CLOSE ;===== if you press the x in the topbar exit script
- WinClose($WinTitle, "")
- ExitLoop
- Case $ConnButton ;===== Connect PC with target via FTP
- _ftp()
- GUICtrlSetState($screenButton, $GUI_ENABLE)
- GUICtrlSetBkColor($screenButton, 0x00FF00); rün: 0x00FF00
- _WinAPI_RedrawWindow($WinMain)
- Case $NewButton ;===== new bug found
- GUICtrlSetBkColor($NewButton, 0xFF0000); grün: 0x00FF00
- GUICtrlSetState($SaveButton, $GUI_ENABLE) ; activate SaveButton
- _WinAPI_RedrawWindow($WinMain) ; redraw complete window
- GUICtrlSetState($NewButton, $GUI_DISABLE) ; deactivate NewButton until Savebutton is clicked
- ;====== call func _dateset to set timestamp
- _dateset()
- ;====== get local date and time from box to create dir-name
- $timestamp = GUICtrlRead($date)
- GUICtrlSetState($date, $GUI_DISABLE) ; deactivate date input
- ;====== create local directory with local date and time to save files
- If (DirCreate($directory & $timestamp) == 0) Then;
- MsgBox(16, "Attention!", "No Folder created." & @CRLF & "Please restart the program")
- ;Exit
- EndIf
- _WinAPI_RedrawWindow($WinMain, $RDW_UPDATENOW)
- ;====== call func _ftpdownload to get all neccessary files from SD card, if RadioButton1 is activated
- Local $logoread = GUICtrlRead($radio1)
- If $logoread = 1 Then
- _ftpdownload()
- EndIf
- _WinAPI_RedrawWindow($WinMain)
- Case $screenButton ;====== Take Screenshot ======
- ;===== call func _screen_dateset to get new timestamp
- ConsoleWrite(@ScriptLineNumber & " Call _screen_dateset()" & @CRLF)
- _screen_dateset() ; set timestamp for screenshot
- ;===== open Telnet to connect to target
- ConsoleWrite(@ScriptLineNumber & " Call _telnet()" & @CRLF)
- _telnet() ; open telnet connection
- _WinAPI_RedrawWindow($WinMain, $RDW_UPDATENOW)
- ;===== call func _screenshot to take screenshot
- ConsoleWrite(@ScriptLineNumber & " Call _screenshot()" & @CRLF)
- _screenshot() ; call func
- _WinAPI_RedrawWindow($WinMain, $RDW_UPDATENOW)
- ;===== main structure to take screenshot
- While WinExists($WinTitle, "")
- If WinActive($WinTitle, "") Then
- HotKeySet("{F10}", "_screenshot")
- Else
- ExitLoop
- HotKeySet("{F10}")
- EndIf
- Sleep(20)
- WEnd
- Sleep(2000)
- _WinAPI_RedrawWindow($WinMain)
- Case $SaveButton ;====== Button to save textbox input to file
- GUICtrlSetState($NewButton, $GUI_ENABLE)
- GUICtrlSetState($SaveButton, $GUI_DISABLE)
- GUICtrlSetBkColor($NewButton, 0x00FF00); rün: 0x00FF00, rot: 0xFF0000
- ;====== save all textboxes to textfile
- $file = FileOpen($directory & $timestamp & '\' & $filename, 2)
- $string1 = GUICtrlRead($EditText1)
- $string2 = GUICtrlRead($EditText2)
- $string3 = GUICtrlRead($EditText3)
- $string4 = GUICtrlRead($EditText4)
- $string5 = GUICtrlRead($EditText5)
- FileWrite($file, $box1 & @CRLF)
- FileWrite($file, $string1 & @CRLF & @CRLF)
- FileWrite($file, $box2 & @CRLF)
- FileWrite($file, $string2 & @CRLF & @CRLF)
- FileWrite($file, $box3 & @CRLF)
- FileWrite($file, $string3 & @CRLF & @CRLF)
- FileWrite($file, $box4 & @CRLF)
- FileWrite($file, $string4 & @CRLF & @CRLF)
- FileWrite($file, $box5 & @CRLF)
- FileWrite($file, $string5 & @CRLF & @CRLF)
- FileClose($file)
- If FileExists($directory & $timestamp & '\' & $filename) Then ;===== Lookup Textfile and activate Edit_Button
- GUICtrlSetState($EditButton, $GUI_ENABLE)
- EndIf
- _WinAPI_RedrawWindow($WinMain)
- ;====== clear the first 4 textboxes
- GUICtrlSetData($EditText1, "")
- GUICtrlSetData($EditText2, "")
- GUICtrlSetData($EditText3, "")
- GUICtrlSetData($EditText4, "")
- _WinAPI_RedrawWindow($WinMain, $RDW_UPDATENOW)
- Case $EditButton ;===== opens editor to work with saved Textfile
- $edit = ShellExecuteWait($directory & $timestamp & '\' & $filename)
- ConsoleWrite(@ScriptLineNumber & " ShellExecuteWait($directory & $timestamp & '\' & $filename: " & $directory & $timestamp & '\' & $filename & @CRLF)
- While ProcessExists($edit)
- WEnd
- _WinAPI_RedrawWindow($WinMain)
- Case $ExitButton ;===== end programm
- WinClose($WinTitle, "")
- ExitLoop
- EndSwitch
- WEnd
- EndFunc ;==>_Main
- ;======= End _Main ==================================
- ;====================================================
- ;====================================================
- ;=========== single functions =======================
- ;====================================================
- ;====================================================
- ;======= Set date and timestamp for bugreport =======
- Func _dateset()
- GUICtrlDelete($date) ;= reset old timestamp
- $date = GUICtrlCreateDate("", 1020, 60, 150, 20)
- GUICtrlSetFont($date, 10, 1000, 0, $font)
- GUICtrlSetColor(-1, 0xFAFFFF)
- GUICtrlSetBkColor(-2, 0x000000)
- ;=======set format of the timestamp
- $DTM_SETFORMAT_ = 0x1032 ; $DTM_SETFORMATW
- GUICtrlSendMsg($date, $DTM_SETFORMAT_, 0, $style)
- EndFunc ;==>_dateset
- ;====================================================
- ;========= FTP Funcs ================================
- ;====================================================
- ;========= FTP function to save defined files =======
- Func _ftp()
- ;~======= FTP-Data
- Local $server = $adress
- ConsoleWrite(@ScriptLineNumber & " Local $server = $adress: " & $server & @CRLF)
- Local $username = ''
- Local $pass = ''
- Local $u, $ftpFile, $file, $right, $p, $ftpFile1, $file1, $right1, $slot
- Local $Open = _FTP_Open('MyFTP Control')
- If @error Then
- MsgBox(16, "FTP_Open_Error", "No FTP connection to" & @CRLF & $adress & " possible!")
- EndIf
- $Conn = _FTP_Connect($Open, $server, $username, $pass)
- If @error Then
- MsgBox(16, "FTP_Connect_Error", "No FTP connection to" & @CRLF & $adress & " possible!")
- Else
- ;===== activate buttons, disabled at startup
- GUICtrlSetBkColor($ConnButton, 0x00ff00) ; Green
- GUICtrlSetState($SaveButton, $GUI_ENABLE)
- GUICtrlSetState($NewButton, $GUI_ENABLE)
- EndIf
- EndFunc ;==>_ftp
- ;======= download function to get all ness. files from target
- Func _ftpdownload()
- $slot = $slotname1
- _FTP_DirSetCurrent($Conn, $slot)
- If @error Then
- MsgBox(16, "Dir_error", "No FTP connection to" & @CRLF & $adress & " possible!")
- EndIf
- $ftpFile = _Ftp_ListToArray($Conn, 2)
- If IsArray($ftpFile) Then
- For $u = 1 To $ftpFile[0]
- $right = StringRight($ftpFile[$u], 4)
- If $right = $debugname Or $right = $picname Or $right = $pmdname Then
- _FTP_FileGet($Conn, $ftpFile[$u], $directory & $timestamp & "\" & $ftpFile[$u])
- If @error Then
- _sloterror()
- EndIf
- If $right = $debugname Or $right = $picname Or $right = $pmdname Then
- _FTP_FileDelete($Conn, $ftpFile[$u])
- If @error Then
- MsgBox(16, "Error", "Could not delete copied files on " & $slot & " !" & @CRLF & "Please delete files manually!", 10)
- EndIf
- EndIf
- EndIf
- Next
- Else
- MsgBox(16, "Error", "No FTP connection to" & @CRLF & $adress & " possible!")
- EndIf
- $slot = $slotname2
- _FTP_DirSetCurrent($Conn, $slot)
- $ftpFile1 = _Ftp_ListToArray($Conn, 2)
- If IsArray($ftpFile1) Then
- For $p = 1 To $ftpFile1[0]
- $right1 = StringRight($ftpFile1[$p], 4)
- If $right1 = $trackname Then
- _FTP_FileGet($Conn, $ftpFile1[$p], $directory & $timestamp & "\" & $ftpFile1[$p])
- If @error Then
- _sloterror()
- EndIf
- If $right1 = $debugname Then
- _FTP_FileDelete($Conn, $ftpFile1[$p])
- If @error Then
- MsgBox(16, "Error", "Could not clean up " & $slot & " !" & @CRLF & "Please delete files manually!" & @CRLF & @CRLF & "Files are stored in " & $directory & $timestamp, 10)
- EndIf
- EndIf
- EndIf
- Next
- Else
- MsgBox(16, "Error", "No FTP connection to" & @CRLF & $adress & " possible!")
- EndIf
- EndFunc ;==>_ftpdownload
- ;==========================================================
- ;=========== Screenshot functions =========================
- ;==========================================================
- ;============== Set Date and timestamp for screenshots ====
- Func _screen_dateset()
- GUICtrlDelete($screendate) ;= reset old timestamp
- $screendate = GUICtrlCreateDate("", 1, 1, 10, 10)
- GUICtrlSetFont($screendate, 0, 0, 0, $font)
- ;=======set format of the timestamp
- $DTM_SETFORMAT_ = 0x1032 ; $DTM_SETFORMATW
- GUICtrlSendMsg($screendate, $DTM_SETFORMAT_, 0, $style)
- EndFunc ;==>_screen_dateset
- ;======= Func to open telnet connection ===================
- Func _telnet()
- ; Run Telnet
- Local $telnet = Run("telnet " & $adress, @SystemDir) ; @SW_HIDE, , $STDIN_CHILD + $STDOUT_CHILD
- ConsoleWrite(@ScriptLineNumber & " Run( telnet & $adress, @SystemDir): " & $telnet & @CRLF)
- WinWait("Telnet " & $adress, "", 1)
- ;======= Rename window
- $WinTitle = "Telnet connection to MIB target <<- Screenshot ->>"
- WinSetTitle("Telnet " & $adress, "", $WinTitle)
- WinMove($WinTitle, "", 0, 0, 30, 30)
- EndFunc ;==>_telnet
- ;======== take screenshot =================================
- Func _screenshot()
- If (WinActivate($WinTitle) = 0) Then
- MsgBox(48, "Attention", "Could not copy any files from:" & @CRLF & $slot)
- Exit
- EndIf
- $short_picname = StringRight($picname, 3)
- ConsoleWrite(@ScriptLineNumber & " Func _screenshot, StringRight($picname, 3)" & $short_picname & @CRLF)
- GUICtrlSetBkColor($screenButton, 0xFF0000); rot: 0xFF0000
- Local $picpath1 = StringTrimLeft($picpath, 1) ;===> cut left backslash from ini entry
- ConsoleWrite(@ScriptLineNumber & " Func _screenshot, StringTrimLeft($picpath, 1)" & $picpath1 & @CRLF)
- Local $picpath2 = StringTrimRight($picpath1, 1) ;===> cut right backslash from ini entry
- ConsoleWrite(@ScriptLineNumber & " Func _screenshot, StringTrimLeft($picpath, 1)" & $picpath2 & @CRLF)
- $Screenshot_name = GUICtrlRead($screendate)
- ConsoleWrite(@ScriptLineNumber & " Func _screenshot, GUICtrlRead($screendate)" & $Screenshot_name & @CRLF)
- xSend($WinTitle, "cd " & $picpath2 & "{ENTER}")
- xSend($WinTitle, "screenshot.exe " & $picpath & $Screenshot_name & $picname & " image/" & $short_picname & "{ENTER}")
- ConsoleWrite(@ScriptLineNumber & " Func _screenshot, $picpath & $Screenshot_name & $picname & image / & $short_picname" & $picpath & $Screenshot_name & $picname & " image/" & $short_picname & @CRLF)
- Sleep(100)
- ; xSend($WinTitle, "cd.. " & "{ENTER}")
- ; WinClose($WinTitle, "")
- GUICtrlDelete($screendate)
- GUICtrlSetBkColor($screenButton, 0x00FF00); grün: 0x00FF00
- EndFunc ;==>_screenshot
- ;====== telnet input for screenshot =======================
- Func xSend($aWinTitle, $aString)
- WinActivate($aWinTitle, "")
- Send($aString)
- EndFunc ;==>xSend
- ;====== get screenshot from target and show in window =====
- ;======= Redraw func to set PNG to WinMain if programm has been minimized
- ;==========================================================
- ;======== Funcs to read or write the INIfile ==============
- ;==========================================================
- ;======= Func to read out added inifile ===================
- Func _ebiniread()
- If (FileOpen(@ScriptDir & '\EB.ini', 0)) Then
- $progname = IniRead(@ScriptDir & '\EB.ini', 'NAME', 'progname', 'EB-Bugreporter')
- $box1 = IniRead(@ScriptDir & '\EB.ini', 'BOXES', 'box1', 'Summary')
- $box2 = IniRead(@ScriptDir & '\EB.ini', 'BOXES', 'box2', 'Preconditions')
- $box3 = IniRead(@ScriptDir & '\EB.ini', 'BOXES', 'box3', 'Action')
- $box4 = IniRead(@ScriptDir & '\EB.ini', 'BOXES', 'box4', 'Bug')
- $box5 = IniRead(@ScriptDir & '\EB.ini', 'BOXES', 'box5', 'Environments')
- $directory = IniRead(@ScriptDir & '\EB.ini', 'SAVEPATH', 'path', 'C:\Testfiles\')
- $slotname1 = IniRead(@ScriptDir & '\EB.ini', 'TARGET', 'sdslot1', '\SDCARD0\')
- $slotname2 = IniRead(@ScriptDir & '\EB.ini', 'TARGET', 'sdslot2', '\SDCARD1\')
- $adress = IniRead(@ScriptDir & '\EB.ini', 'TARGET', 'adress', '192.168.1.4')
- $filename = IniRead(@ScriptDir & '\EB.ini', 'REPORT', 'name', 'Testfile.txt')
- $dummypic = IniRead(@ScriptDir & '\EB.ini', 'REPORT', 'dummypic', 'EB-Logo.png')
- $debugpath = IniRead(@ScriptDir & '\EB.ini', 'FILEPATH', 'debugpath', '\SDCARD0\')
- $trackpath = IniRead(@ScriptDir & '\EB.ini', 'FILEPATH', 'trackpath', '\SDCARD1\navigation\tracks\')
- $picpath = IniRead(@ScriptDir & '\EB.ini', 'FILEPATH', 'picpath', '\SDCARD0\')
- $pmdpath = IniRead(@ScriptDir & '\EB.ini', 'FILEPATH', 'picpath', '\SDCARD0\')
- $debugname = IniRead(@ScriptDir & '\EB.ini', 'FILES', 'debug', '.dbg')
- $trackname = IniRead(@ScriptDir & '\EB.ini', 'FILES', 'track', '.trk')
- $picname = IniRead(@ScriptDir & '\EB.ini', 'FILES', 'pic', '.png')
- $pmdname = IniRead(@ScriptDir & '\EB.ini', 'FILES', 'pmd', '.log')
- Else
- _ebiniwrite() ;= if no inifile found, create own new standard ini
- EndIf
- FileClose(@ScriptDir & '\EB.ini')
- EndFunc ;==>_ebiniread
- ;======= Func to write new ini, if inifile is not present =
- Func _ebiniwrite()
- $progname = IniWrite(@ScriptDir & '\EB.ini', 'NAME', 'progname', 'EB-Bugreporter')
- $box2 = IniWrite(@ScriptDir & '\EB.ini', 'BOXES', 'box2', 'Preconditions')
- $box3 = IniWrite(@ScriptDir & '\EB.ini', 'BOXES', 'box3', 'Action')
- $box4 = IniWrite(@ScriptDir & '\EB.ini', 'BOXES', 'box4', 'Bug')
- $box5 = IniWrite(@ScriptDir & '\EB.ini', 'BOXES', 'box5', 'Environments')
- $directory = IniWrite(@ScriptDir & '\EB.ini', 'SAVEPATH', 'path', 'C:\Testfiles\')
- $slotname1 = IniWrite(@ScriptDir & '\EB.ini', 'TARGET', 'sdslot1', '\SDCARD0\')
- $slotname2 = IniWrite(@ScriptDir & '\EB.ini', 'TARGET', 'sdslot2', '\SDCARD1\')
- $adress = IniWrite(@ScriptDir & '\EB.ini', 'TARGET', 'adress', '192.168.1.4')
- $filename = IniWrite(@ScriptDir & '\EB.ini', 'REPORT', 'name', 'Testfile.txt')
- $dummypic = IniWrite(@ScriptDir & '\EB.ini', 'REPORT', 'dummypic', 'EB-Logo.png')
- $debugpath = IniWrite(@ScriptDir & '\EB.ini', 'FILEPATH', 'debugpath', '\SDCARD0\')
- $trackpath = IniWrite(@ScriptDir & '\EB.ini', 'FILEPATH', 'trackpath', '\SDCARD1\navigation\tracks\')
- $picpath = IniWrite(@ScriptDir & '\EB.ini', 'FILEPATH', 'picpath', '\SDCARD0\')
- $pmdpath = IniWrite(@ScriptDir & '\EB.ini', 'FILEPATH', 'pmdpath', '\SDCARD0\')
- $debugname = IniWrite(@ScriptDir & '\EB.ini', 'FILES', 'debug', '.dbg')
- $trackname = IniWrite(@ScriptDir & '\EB.ini', 'FILES', 'track', '.trk')
- $picname = IniWrite(@ScriptDir & '\EB.ini', 'FILES', 'pic', '.png')
- $pmdname = IniWrite(@ScriptDir & '\EB.ini', 'FILES', 'pmd', '.log')
- MsgBox(48, "Attention", "EB.ini missed in scriptfolder." & @CRLF & "Defaults have been set to new EB.ini." & @CRLF & @CRLF & "Please have a look into your programm folder" & @CRLF & @CRLF & "The program has to be started again.")
- WinClose($WinTitle, "")
- Local $Ftpc = _FTP_Close($Open)
- Exit
- EndFunc ;==>_ebiniwrite
- ;==========================================================
- ;====== Oooops-funcs following ============================
- ;==========================================================
- Func _sloterror()
- MsgBox(48, "Attention", "Could not copy any files from:" & @CRLF & $slot)
- WinClose($WinTitle, "")
- Local $Ftpc = _FTP_Close($Open)
- Return 0
- EndFunc ;==>_sloterror
- Func _telneterror()
- MsgBox(16, "Error", "No TELNET connection to" & @CRLF & $adress & " possible!")
- WinClose($WinTitle, "")
- Local $Ftpc = _FTP_Close($Open)
- Return -1
- ;Exit
- EndFunc ;==>_telneterror
- ;==========================================================
- ;====== End ===============================================
- ;==========================================================
Add Comment
Please, Sign In to add comment