WindowsXP-SP1/admin/cys/test/test-browseforfolder2.htm
2020-09-30 16:53:49 +02:00

72 lines
1.4 KiB
HTML

<HTML>
<HEAD>
<TITLE>IConfigureYourServer::BrowseForFolder test</TITLE>
<SCRIPT LANGUAGE="VBScript">
Function showAlert(strAlertString)
MsgBox strAlertString
End Function
</SCRIPT>
<SCRIPT LANGUAGE=VBScript>
Function folder()
Dim oShell, oFolder, oFolderItem
CONST ssfDRIVES = 17 'ShellSpecialFolderConstants
Set oShell = CreateObject("Shell.Application")
On Error Resume Next
Set oFolder = oShell.BrowseForFolder(0, "Select a Share Folder", 0 , ssfDRIVES)
Set oFolderItem = oFolder.Items.Item
thePath = Trim(oFolderItem.Path)
If InStr(thePath, "::{") Then
showAlert "Please select a folder."
form.btnFindFolder.focus()
folder()
Elseif thePath = "" OR IsNull(thePath) Then
Exit Function
Else
form.txtFolderName.value=oFolderItem.Path
form.txtShareName.focus()
End if
Set oShell = nothing
End Function
</SCRIPT>
<SCRIPT LANGUAGE="JScript">
function
button1OnClick()
{
folder();
}
function
button2OnClick()
{
showAlert("button 2 clicked");
}
</SCRIPT>
</HEAD>
<BODY>
<P>
<BUTTON ID="button1" NAME="button1" ONCLICK="button1OnClick()">
Browse
</BUTTON>
<BUTTON ID="button2" NAME="button2" ONCLICK="button2OnClick()">
Button
</BUTTON>
</P>
</BODY>
</HTML>