42 lines
1.3 KiB
AutoIt
42 lines
1.3 KiB
AutoIt
#include <GUIConstantsEx.au3>
|
|
#include <GuiComboBox.au3>
|
|
#include <Constants.au3>
|
|
#include <Process.au3>
|
|
#NoTrayIcon
|
|
|
|
Opt("TrayIconHide", 1)
|
|
Opt("ExpandEnvStrings", 1)
|
|
|
|
$Main = GUICreate('Web Disk Connectivity', 282, 79, 318, 213)
|
|
$ButtON = GUICtrlCreateButton("Connect Drive", 8, 38, 121, 33)
|
|
GUICtrlSetFont(-1, 8, 800, 0, "Tahoma")
|
|
$ButtOFF = GUICtrlCreateButton("Disconnect Drive", 153, 38, 121, 33)
|
|
GUICtrlSetFont(-1, 8, 800, 0, "Tahoma")
|
|
$Combo = GUICtrlCreateCombo("", 8, 8, 266, 296, $GUI_SS_DEFAULT_COMBO)
|
|
GUISetState(@SW_SHOW)
|
|
|
|
_GUICtrlComboBox_BeginUpdate($Combo)
|
|
_GUICtrlComboBox_AddDir($Combo, @ScriptDir & "\Settings\*.ini")
|
|
_GUICtrlComboBox_EndUpdate($Combo)
|
|
|
|
While 1
|
|
$Ini = GUICtrlRead($Combo)
|
|
$init = @ScriptDir & "\Settings\" & $ini
|
|
$Server = IniRead($init, "Connect", "Server", "")
|
|
$Login = IniRead($init, "Connect", "Login", "")
|
|
$Pass = IniRead($init, "Connect", "Password", "")
|
|
$Letter = IniRead($init, "Drive", "Letter", "")
|
|
$Label = IniRead($init, "Drive", "Label", "")
|
|
|
|
Switch GUIGetMsg()
|
|
Case $GUI_EVENT_CLOSE
|
|
ExitLoop
|
|
Case $ButtON
|
|
DriveMapAdd($Letter & ":", $Server, 0, $Login, $Pass)
|
|
$oShell = ObjCreate("shell.application")
|
|
$oShell.NameSpace($Letter & ":").Self.Name = $Label
|
|
Case $ButtOFF
|
|
DriveMapDel($Letter & ":")
|
|
EndSwitch
|
|
WEnd
|