Source code of Windows XP (NT5)
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.

84 lines
1.7 KiB

  1. <HTML>
  2. <HEAD>
  3. <TITLE>IConfigureYourServer::BrowseForFolder test</TITLE>
  4. <SCRIPT LANGUAGE="VBScript">
  5. Dim srvwiz
  6. Set srvwiz = CreateObject("ServerAdmin.ConfigureYourServer")
  7. Function showAlert(strAlertString)
  8. MsgBox strAlertString
  9. End Function
  10. </SCRIPT>
  11. <SCRIPT LANGUAGE=VBScript>
  12. Function folder()
  13. Dim oShell, oFolder, oFolderItem
  14. CONST ssfDRIVES = 17 'ShellSpecialFolderConstants
  15. Set oShell = CreateObject("Shell.Application")
  16. On Error Resume Next
  17. Set oFolder = oShell.BrowseForFolder(0, "Select a Share Folder", 0 , ssfDRIVES)
  18. Set oFolderItem = oFolder.Items.Item
  19. thePath = Trim(oFolderItem.Path)
  20. If InStr(thePath, "::{") Then
  21. showAlert "Please select a folder."
  22. form.btnFindFolder.focus()
  23. folder()
  24. Elseif thePath = "" OR IsNull(thePath) Then
  25. Exit Function
  26. Else
  27. form.txtFolderName.value=oFolderItem.Path
  28. form.txtShareName.focus()
  29. End if
  30. Set oShell = nothing
  31. End Function
  32. </SCRIPT>
  33. <SCRIPT LANGUAGE="JScript">
  34. function
  35. button1OnClick()
  36. {
  37. var browseResult = srvwiz.BrowseForFolder("This is the title");
  38. showAlert(browseResult);
  39. }
  40. function
  41. button2OnClick()
  42. {
  43. showAlert("button 2 clicked");
  44. }
  45. function
  46. button3OnClick()
  47. {
  48. folder();
  49. }
  50. </SCRIPT>
  51. </HEAD>
  52. <BODY>
  53. <P>
  54. <BUTTON ID="button1" NAME="button1" ONCLICK="button1OnClick()">
  55. New Browse
  56. </BUTTON>
  57. <BUTTON ID="button2" NAME="button2" ONCLICK="button2OnClick()">
  58. Button
  59. </BUTTON>
  60. <BUTTON ID="button3" NAME="button3" ONCLICK="button3OnClick()">
  61. Old Browse
  62. </BUTTON>
  63. </P>
  64. </BODY>
  65. </HTML>