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

85 lines
1.7 KiB
HTML
Raw Permalink Normal View History

2020-09-26 03:20:57 -05:00
<HTML>
<HEAD>
<TITLE>IConfigureYourServer::BrowseForFolder test</TITLE>
<SCRIPT LANGUAGE="VBScript">
Dim srvwiz
Set srvwiz = CreateObject("ServerAdmin.ConfigureYourServer")
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()
{
var browseResult = srvwiz.BrowseForFolder("This is the title");
showAlert(browseResult);
}
function
button2OnClick()
{
showAlert("button 2 clicked");
}
function
button3OnClick()
{
folder();
}
</SCRIPT>
</HEAD>
<BODY>
<P>
<BUTTON ID="button1" NAME="button1" ONCLICK="button1OnClick()">
New Browse
</BUTTON>
<BUTTON ID="button2" NAME="button2" ONCLICK="button2OnClick()">
Button
</BUTTON>
<BUTTON ID="button3" NAME="button3" ONCLICK="button3OnClick()">
Old Browse
</BUTTON>
</P>
</BODY>
</HTML>