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.

71 lines
1.3 KiB

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