mirror of
https://github.com/n00mkrad/flowframes.git
synced 2025-12-16 16:37:48 +01:00
Check OS compat on startup, prompt for enabling dev mode
This commit is contained in:
@@ -3,7 +3,10 @@ using System.Text;
|
||||
using System.Security.Principal;
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Management;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
using Flowframes.IO;
|
||||
using DiskDetector;
|
||||
using DiskDetector.Models;
|
||||
@@ -132,5 +135,25 @@ namespace Flowframes.OS
|
||||
return 1000;
|
||||
}
|
||||
}
|
||||
|
||||
public static string GetOs()
|
||||
{
|
||||
string info = "";
|
||||
|
||||
using (ManagementObjectSearcher searcher = new ManagementObjectSearcher("SELECT * FROM Win32_OperatingSystem"))
|
||||
{
|
||||
ManagementObjectCollection information = searcher.Get();
|
||||
|
||||
if (information != null)
|
||||
{
|
||||
foreach (ManagementObject obj in information)
|
||||
info = $"{obj["Caption"]} | {obj["OSArchitecture"]}";
|
||||
}
|
||||
|
||||
info = info.Replace("NT 5.1.2600", "XP").Replace("NT 5.2.3790", "Server 2003");
|
||||
}
|
||||
|
||||
return info;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user