IISVersionInfo.cs 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. /**
  2. * Namespace: System.Web.Util
  3. * Class: IISVersionInfo
  4. *
  5. * Author: Gaurav Vaish
  6. * Maintainer: [email protected]
  7. * Contact: <[email protected]>, <[email protected]>
  8. * Implementation: yes
  9. * Status: ??%
  10. *
  11. * (C) Gaurav Vaish (2001)
  12. */
  13. using System;
  14. using System.Diagnostics;
  15. using System.Web;
  16. namespace System.Web.Util
  17. {
  18. //FIXME: This is highly Windows/IIS specific code. What about Apache related stuff?
  19. internal class IISVersionInfo
  20. {
  21. private static string isapiVersion;
  22. private static string mscoreeVersion;
  23. private static string systemWebVersion;
  24. private static readonly object lockObj = null;
  25. public IISVersionInfo()
  26. {
  27. }
  28. internal static string IsapiVersion
  29. {
  30. get
  31. {
  32. if(isapiVersion==null)
  33. {
  34. lock(lockObj)
  35. {
  36. // Recheck - another thread may have set the value
  37. // before entering lock / exiting previous lock
  38. if(isapiVersion==null)
  39. {
  40. //FIXME: What about Apache? What dll/shared-object to be loaded?
  41. isapiVersion = GetLoadedModuleVersion("aspnet_isapi.dll");
  42. }
  43. }
  44. }
  45. return isapiVersion;
  46. }
  47. }
  48. internal static string ClrVersion
  49. {
  50. get
  51. {
  52. if(mscoreeVersion==null)
  53. {
  54. lock(lockObj)
  55. {
  56. if(mscoreeVersion==null)
  57. {
  58. mscoreeVersion = GetLoadedModuleVersion("mscorlib.dll");
  59. }
  60. }
  61. }
  62. return mscoreeVersion;
  63. }
  64. }
  65. internal static string SystemWebVersion
  66. {
  67. get
  68. {
  69. if(systemWebVersion == null)
  70. {
  71. lock(lockObj)
  72. {
  73. if(systemWebVersion==null)
  74. {
  75. systemWebVersion = (FileVersionInfo.GetVersionInfo((typeof(HttpRuntime)).Module.FullyQualifiedName)).FileVersion;
  76. }
  77. }
  78. }
  79. return systemWebVersion;
  80. }
  81. }
  82. [MonoTODO]
  83. internal static string GetLoadedModuleVersion(string modulename)
  84. {
  85. //TODO: Load the version information from the module
  86. // Needs native calls - which ones, since the module will not be .Net aware
  87. throw new NotImplementedException();
  88. }
  89. [MonoTODO]
  90. internal static string GetLoadedModuleFilename(string modulename)
  91. {
  92. throw new NotImplementedException();
  93. }
  94. }
  95. }