AdjustSdk.Uap.SystemInfoEstimate.GetWindowsVersionAsync C# (CSharp) Méthode

GetWindowsVersionAsync() public static méthode

public static GetWindowsVersionAsync ( ) : Task
Résultat Task
        public static async Task<string> GetWindowsVersionAsync()
        {
            // There is no good place to get this.
            // The HAL driver version number should work unless you're using a custom HAL...
            var hal = await GetHalDevice(DeviceDriverVersionKey);
            if (hal == null || !hal.Properties.ContainsKey(DeviceDriverVersionKey))
                return null;

            var versionParts = hal.Properties[DeviceDriverVersionKey].ToString().Split('.');
            return string.Join(".", versionParts.Take(2).ToArray());
        }

Usage Example

Exemple #1
0
 public static string GetOsVersion()
 {
     return(SystemInfoEstimate.GetWindowsVersionAsync().Result);
 }