Подключает сетевые диски и хранилища DAV.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 

41 lines
1.3 KiB

#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