CosVersion.cs 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Reflection;
  4. using System.Diagnostics;
  5. using System.Text;
  6. namespace COSXML.Common
  7. {
  8. public sealed class CosVersion
  9. {
  10. private static string SDKVersion = "5.4.34.0";
  11. public static string GetUserAgent()
  12. {
  13. StringBuilder userAgent = new StringBuilder();
  14. userAgent.Append("cos-net-sdk").Append('.')
  15. .Append(SDKVersion);
  16. return userAgent.ToString();
  17. }
  18. //public static string GetOsVersion()
  19. //{
  20. // try
  21. // {
  22. // var os = Environment.OSVersion;
  23. // return "windows " + os.Version.Major + "." + os.Version.Minor;
  24. // }
  25. // catch (InvalidOperationException)
  26. // {
  27. // return "Unknown OSVersion";
  28. // }
  29. //}
  30. //public static string GetOsArchitecture()
  31. //{
  32. // return (IntPtr.Size == 8) ? "x86_64" : "x86";
  33. //}
  34. }
  35. }