-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAbout.aspx.cs
47 lines (42 loc) · 1.47 KB
/
About.aspx.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
using System;
using System.Runtime.InteropServices;
namespace PIX_BancoDoBrasil
{
public partial class About : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
lblWindowsVersion.Text = GetWindowsVersion();
lblOSDescription.Text = GetOSDescription();
}
}
private string GetOSDescription()
{
return RuntimeInformation.OSDescription;
}
private string GetWindowsVersion()
{
//return RuntimeInformation.OSDescription;
var osVersion = Environment.OSVersion;
var version = osVersion.Version;
if (osVersion.Platform == PlatformID.Win32NT)
{
if (version.Major == 10)
return "Windows 10";
else if (version.Major == 6 && version.Minor == 3)
return "Windows 8.1";
else if (version.Major == 6 && version.Minor == 2)
return "Windows 8";
else if (version.Major == 6 && version.Minor == 1)
return "Windows 7";
else if (version.Major == 6 && version.Minor == 0)
return "Windows Vista";
else if (version.Major == 5 && version.Minor == 1)
return "Windows XP";
}
return RuntimeInformation.OSDescription;
}
}
}