windows-nt/Source/XPSP1/NT/admin/cys/test/test-browseforfolder2.htm

72 lines
1.3 KiB
HTML
Raw Normal View History

2020-09-26 03:20:57 -05:00
<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>