Leaked source code of windows server 2003
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.

96 lines
3.0 KiB

  1. <%@ Language=VbScript%>
  2. <% Option Explicit %>
  3. <%
  4. '-------------------------------------------------------------------------
  5. ' Openfiles_Resources.asp : Resource Viewer for shutdown page
  6. '
  7. ' Copyright (c) Microsoft Corporation. All rights reserved.
  8. '
  9. ' Date Description
  10. ' 04-Jan-01 Creation Date
  11. ' 27-Mar-01 Modified Date
  12. '-------------------------------------------------------------------------
  13. %>
  14. <!-- #include virtual="/admin/inc_framework.asp" -->
  15. <!-- #include file="loc_OpenFiles_msg.asp" -->
  16. <%
  17. Call ServeResources()
  18. '----------------------------------------------------------------------------
  19. ' Function: ServeResources
  20. ' Description: Serves the resources
  21. ' Input: None
  22. ' Output: None
  23. ' GlobalVariables: None
  24. ' Returns: None
  25. '----------------------------------------------------------------------------
  26. Function ServeResources()
  27. Call SA_TraceOut(SA_GetScriptFileName(), "ServeResources()")
  28. 'get Openfiles details
  29. call OpensharedfilesCount()
  30. ServeResources = true
  31. End Function
  32. '----------------------------------------------------------------------------
  33. ' Function: OpensharedfilesCount
  34. ' Description: Gets the count of the open shared files
  35. ' Input: None
  36. ' Output: None
  37. ' GlobalVariables: L_SHAREDFILES_TEXT, L_OPENFILES_TEXT
  38. ' L_NOOPENFILES_TEXT
  39. ' Returns: None
  40. '----------------------------------------------------------------------------
  41. Function OpensharedfilesCount()
  42. Err.Clear
  43. On Error Resume Next
  44. Dim objSharedOpenFiles 'holds the Openfiles object
  45. Dim arrOpFiles 'array of Open files
  46. Dim nOpenSharedFiles 'Number of opened files
  47. Dim RetURL 'holds return URL
  48. Dim arrReplacementStrings(0)'holds the replacement string
  49. OpensharedfilesCount=False
  50. 'Creating an Activex Object to get the number of Shared Openfiles
  51. Set objSharedOpenFiles = CreateObject("Openfiles.Openf")
  52. If Err.number <> 0 then
  53. Call SA_TraceOut(SA_GetScriptFileName(), "CreateObject(Openfiles.Openf) failed: " + CStr(Hex(Err.Number)) + " " + Err.Description)
  54. Exit Function
  55. End If
  56. arrOpFiles = objSharedOpenFiles.getOpenFiles()
  57. nOpenSharedFiles = ubound(arrOpFiles) + 1
  58. arrReplacementStrings(0) = cstr(nOpenSharedFiles)
  59. L_OPENFILES_TEXT = SA_GetLocString("openfiles_msg.dll", "40400002",arrReplacementStrings)
  60. If nOpenSharedFiles > 0 then
  61. Dim sURL 'page URL
  62. sURL = "Openfiles/Openfiles_Openfiles.asp"
  63. Call SA_ServeResourceStatus("images/OpenFolderX16.gif", L_SHAREDFILES_TEXT, L_SHAREDFILES_TEXT,sURL, "_top", L_OPENFILES_TEXT)
  64. Else
  65. 'serve if there are no files opened on serverappliance
  66. Call SA_ServeResourceStatus("images/OpenFolderX16.gif", L_SHAREDFILES_TEXT, L_SHAREDFILES_TEXT, SA_DEFAULT, SA_DEFAULT, L_OPENFILES_TEXT)
  67. End if
  68. 'Release the object
  69. Set objSharedOpenFiles = nothing
  70. OpensharedfilesCount = true
  71. End Function
  72. %>