20230115
This commit is contained in:
parent
4649373a3d
commit
d3171a1164
340
anbs_cp/Classes/OsInfo.cs
Normal file
340
anbs_cp/Classes/OsInfo.cs
Normal file
@ -0,0 +1,340 @@
|
|||||||
|
using System.Management;
|
||||||
|
using System.Net.NetworkInformation;
|
||||||
|
using System.Net.Sockets;
|
||||||
|
|
||||||
|
using anbs_cp.Classes.OsInfos;
|
||||||
|
using anbs_cp.Enums;
|
||||||
|
using anbs_cp.Interfaces.OsInfos;
|
||||||
|
|
||||||
|
namespace anbs_cp.Classes;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Информация о системе
|
||||||
|
/// </summary>
|
||||||
|
public static class OsInfo
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Конструктор
|
||||||
|
/// </summary>
|
||||||
|
static OsInfo ()
|
||||||
|
{
|
||||||
|
Windows = GetWindowsInfo();
|
||||||
|
Processors = GetProcessors();
|
||||||
|
RAM = GetRAMs();
|
||||||
|
Videos = GetVideoAdapterInfos();
|
||||||
|
Drives = GetDriveInfos();
|
||||||
|
Net = GetNet();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Информация о Windows
|
||||||
|
/// </summary>
|
||||||
|
public static IOsWindowsInfo Windows { get; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Список с информацией о процессоре(-ах)
|
||||||
|
/// </summary>
|
||||||
|
public static List<IOsProcessorInfo> Processors { get; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Количество оперативной памяти в байтах
|
||||||
|
/// </summary>
|
||||||
|
public static ulong RAM { get; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Видеоадаптеры
|
||||||
|
/// </summary>
|
||||||
|
public static List<IOsVideoAdapterInfo> Videos { get; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Диски
|
||||||
|
/// </summary>
|
||||||
|
public static List<IOsDriveInfo> Drives { get; set; }
|
||||||
|
|
||||||
|
public static List<IOsNetInfo> Net { get; set; }
|
||||||
|
|
||||||
|
#region Служебные методы
|
||||||
|
/// <summary>
|
||||||
|
/// Получает информацию о Windows
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
|
private static IOsWindowsInfo GetWindowsInfo () =>
|
||||||
|
new OsWindowsInfo
|
||||||
|
{
|
||||||
|
Version = Environment.OSVersion.ToString(),
|
||||||
|
Is64 = Environment.Is64BitOperatingSystem,
|
||||||
|
PcName = Environment.MachineName,
|
||||||
|
WindowsFolder = Environment.SystemDirectory
|
||||||
|
};
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Получение процессоров
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>Список информации о процессорах</returns>
|
||||||
|
private static List<IOsProcessorInfo> GetProcessors ()
|
||||||
|
{
|
||||||
|
//Создаю результирующий список
|
||||||
|
List<IOsProcessorInfo> processorsList = new();
|
||||||
|
|
||||||
|
//Создаю классы менеджмента
|
||||||
|
ManagementClass management = new("Win32_Processor");
|
||||||
|
ManagementObjectCollection collection = management.GetInstances();
|
||||||
|
|
||||||
|
//Получаю число процессоров
|
||||||
|
int processorsCount = collection.Cast<ManagementObject>()
|
||||||
|
.Select(static a => a.Properties["ProcessorId"].Value.ToString()).Count();
|
||||||
|
|
||||||
|
//Перебираю массив данных
|
||||||
|
for (int ind = 0; ind < processorsCount; ind++)
|
||||||
|
{
|
||||||
|
//Создаю элемент информации о процессоре
|
||||||
|
OsProcessorInfo processor = new()
|
||||||
|
{
|
||||||
|
Caption = collection.Cast<ManagementObject>()
|
||||||
|
.Select(static a => a.Properties["Caption"].Value.ToString()).ElementAtOrDefault(ind),
|
||||||
|
Description = collection.Cast<ManagementObject>()
|
||||||
|
.Select(static a => a.Properties["Description"].Value.ToString()).ElementAtOrDefault(ind),
|
||||||
|
DeviceId = collection.Cast<ManagementObject>()
|
||||||
|
.Select(static a => a.Properties["DeviceID"].Value.ToString()).ElementAtOrDefault(ind),
|
||||||
|
Manufacturer = collection.Cast<ManagementObject>()
|
||||||
|
.Select(static a => a.Properties["Manufacturer"].Value.ToString()).ElementAtOrDefault(ind),
|
||||||
|
MaxClockSpeed = TypeConverter.StrToInt(collection.Cast<ManagementObject>()
|
||||||
|
.Select(static a => a.Properties["MaxClockSpeed"].Value.ToString()).ElementAtOrDefault(ind) ?? "0"),
|
||||||
|
Name = collection.Cast<ManagementObject>()
|
||||||
|
.Select(static a => a.Properties["Name"].Value.ToString()).ElementAtOrDefault(ind),
|
||||||
|
NumberOfCores = TypeConverter.StrToInt(collection.Cast<ManagementObject>()
|
||||||
|
.Select(static a => a.Properties["NumberOfCores"].Value.ToString()).ElementAtOrDefault(ind) ?? "0"),
|
||||||
|
NumberOfLogicalProcessors = TypeConverter.StrToInt(collection.Cast<ManagementObject>()
|
||||||
|
.Select(static a => a.Properties["NumberOfLogicalProcessors"].Value.ToString()).ElementAtOrDefault(ind) ?? "0")
|
||||||
|
};
|
||||||
|
|
||||||
|
//Добавляю в список
|
||||||
|
processorsList.Add(processor);
|
||||||
|
}
|
||||||
|
|
||||||
|
//Возвращаю список
|
||||||
|
return processorsList;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Получение общее количество оперативной памяти
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>Список информации о количестве оперативной памяти</returns>
|
||||||
|
private static ulong GetRAMs ()
|
||||||
|
{
|
||||||
|
//Создаю классы менеджмента
|
||||||
|
ManagementClass management = new("Win32_ComputerSystem");
|
||||||
|
ManagementObjectCollection collection = management.GetInstances();
|
||||||
|
|
||||||
|
//Получаю результат
|
||||||
|
return TypeConverter.StrToUInt64(collection.Cast<ManagementObject>()
|
||||||
|
.Select(static a => a.Properties["TotalPhysicalMemory"].Value.ToString()).FirstOrDefault() ?? "0");
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Получает список видеоадаптеров
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>Список информации о видеоадаптерах</returns>
|
||||||
|
private static List<IOsVideoAdapterInfo> GetVideoAdapterInfos ()
|
||||||
|
{
|
||||||
|
//Создаю результирующий список
|
||||||
|
List<IOsVideoAdapterInfo> videosList = new();
|
||||||
|
|
||||||
|
//Создаю классы менеджмента
|
||||||
|
ManagementClass management = new("Win32_VideoController");
|
||||||
|
ManagementObjectCollection collection = management.GetInstances();
|
||||||
|
|
||||||
|
//Получаю число адаптеров
|
||||||
|
int count = collection.Cast<ManagementObject>()
|
||||||
|
.Select(static a => a.Properties["DeviceID"].Value.ToString()).Count();
|
||||||
|
|
||||||
|
//Перебираю массив данных
|
||||||
|
for (int ind = 0; ind < count; ind++)
|
||||||
|
{
|
||||||
|
//Создаю элемент информации об адаптере
|
||||||
|
OsVideoAdapterInfo adapter = new()
|
||||||
|
{
|
||||||
|
Caption = collection.Cast<ManagementObject>()
|
||||||
|
.Select(static a => a.Properties["Caption"].Value.ToString()).ElementAtOrDefault(ind),
|
||||||
|
Description = collection.Cast<ManagementObject>()
|
||||||
|
.Select(static a => a.Properties["Description"].Value.ToString()).ElementAtOrDefault(ind),
|
||||||
|
DeviceId = collection.Cast<ManagementObject>()
|
||||||
|
.Select(static a => a.Properties["DeviceID"].Value.ToString()).ElementAtOrDefault(ind),
|
||||||
|
AdapterRAM = TypeConverter.StrToInt(collection.Cast<ManagementObject>()
|
||||||
|
.Select(static a => a.Properties["AdapterRAM"].Value.ToString()).ElementAtOrDefault(ind) ?? "0"),
|
||||||
|
DriverDate = collection.Cast<ManagementObject>()
|
||||||
|
.Select(static a => a.Properties["DriverDate"].Value.ToString()).ElementAtOrDefault(ind),
|
||||||
|
Name = collection.Cast<ManagementObject>()
|
||||||
|
.Select(static a => a.Properties["Name"].Value.ToString()).ElementAtOrDefault(ind),
|
||||||
|
CurrentResolution = (TypeConverter.StrToInt(collection.Cast<ManagementObject>()
|
||||||
|
.Select(static a => a.Properties["CurrentHorizontalResolution"].Value.ToString()).ElementAtOrDefault(ind) ?? "0"),
|
||||||
|
TypeConverter.StrToInt(collection.Cast<ManagementObject>()
|
||||||
|
.Select(static a => a.Properties["CurrentVerticalResolution"].Value.ToString())
|
||||||
|
.ElementAtOrDefault(ind) ?? "0")),
|
||||||
|
SystemName = collection.Cast<ManagementObject>()
|
||||||
|
.Select(static a => a.Properties["SystemName"].Value.ToString()).ElementAtOrDefault(ind),
|
||||||
|
DriverVersion = collection.Cast<ManagementObject>()
|
||||||
|
.Select(static a => a.Properties["DriverVersion"].Value.ToString()).ElementAtOrDefault(ind),
|
||||||
|
InstalledDisplayDrivers = collection.Cast<ManagementObject>()
|
||||||
|
.Select(static a => a.Properties["InstalledDisplayDrivers"].Value.ToString()).ElementAtOrDefault(ind),
|
||||||
|
VideoProcessor = collection.Cast<ManagementObject>()
|
||||||
|
.Select(static a => a.Properties["VideoProcessor"].Value.ToString()).ElementAtOrDefault(ind)
|
||||||
|
};
|
||||||
|
|
||||||
|
//Добавляю в список
|
||||||
|
videosList.Add(adapter);
|
||||||
|
}
|
||||||
|
|
||||||
|
//Возвращаю список
|
||||||
|
return videosList;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Получает список дисков
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>Список информации о дисках</returns>
|
||||||
|
private static List<IOsDriveInfo> GetDriveInfos ()
|
||||||
|
{
|
||||||
|
//Создаю результат
|
||||||
|
List<IOsDriveInfo> result = new();
|
||||||
|
|
||||||
|
//Добавление всех HDD/SSD дисков
|
||||||
|
result.AddRange(GetHDDs());
|
||||||
|
|
||||||
|
//Добавление всех CD/DVD/BD дисков
|
||||||
|
result.AddRange(GetCDRom());
|
||||||
|
|
||||||
|
//Вывожу список
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Получаю список HDD/SSD дисков
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>Информация обо всех HDD/SSD дисках</returns>
|
||||||
|
private static List<IOsDriveInfo> GetHDDs ()
|
||||||
|
{
|
||||||
|
//Создаю результирующий список
|
||||||
|
List<IOsDriveInfo> driveList = new();
|
||||||
|
|
||||||
|
//Создаю классы менеджмента
|
||||||
|
ManagementClass management = new("Win32_DiskDrive");
|
||||||
|
ManagementObjectCollection collection = management.GetInstances();
|
||||||
|
|
||||||
|
//Получаю число адаптеров
|
||||||
|
int count = collection.Cast<ManagementObject>()
|
||||||
|
.Select(static a => a.Properties["DeviceID"].Value.ToString()).Count();
|
||||||
|
|
||||||
|
//Перебираю массив данных
|
||||||
|
for (int ind = 0; ind < count; ind++)
|
||||||
|
{
|
||||||
|
//Создаю элемент информации об адаптере
|
||||||
|
OsDriveInfo drive = new()
|
||||||
|
{
|
||||||
|
Type = EDriveType.DtHardDisc,
|
||||||
|
Caption = collection.Cast<ManagementObject>()
|
||||||
|
.Select(static a => a.Properties["Caption"].Value.ToString()).ElementAtOrDefault(ind),
|
||||||
|
Description = collection.Cast<ManagementObject>()
|
||||||
|
.Select(static a => a.Properties["Description"].Value.ToString()).ElementAtOrDefault(ind),
|
||||||
|
DeviceId = collection.Cast<ManagementObject>()
|
||||||
|
.Select(static a => a.Properties["DeviceID"].Value.ToString()).ElementAtOrDefault(ind),
|
||||||
|
Name = collection.Cast<ManagementObject>()
|
||||||
|
.Select(static a => a.Properties["Name"].Value.ToString()).ElementAtOrDefault(ind),
|
||||||
|
TotalSize = TypeConverter.StrToUInt64(collection.Cast<ManagementObject>()
|
||||||
|
.Select(static a => a.Properties["Size"].Value.ToString()).ElementAtOrDefault(ind) ?? "0"),
|
||||||
|
Model = collection.Cast<ManagementObject>()
|
||||||
|
.Select(static a => a.Properties["Model"].Value.ToString()).ElementAtOrDefault(ind)
|
||||||
|
};
|
||||||
|
|
||||||
|
//Добавляю в список
|
||||||
|
driveList.Add(drive);
|
||||||
|
}
|
||||||
|
|
||||||
|
//Возвращаю список
|
||||||
|
return driveList;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Получаю список CD/DVD/BD дисков
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>Информация обо всех CD/DVD/BD дисках</returns>
|
||||||
|
private static List<IOsDriveInfo> GetCDRom ()
|
||||||
|
{
|
||||||
|
//Создаю результирующий список
|
||||||
|
List<IOsDriveInfo> driveList = new();
|
||||||
|
|
||||||
|
//Создаю классы менеджмента
|
||||||
|
ManagementClass management = new("Win32_CDROMDrive");
|
||||||
|
ManagementObjectCollection collection = management.GetInstances();
|
||||||
|
|
||||||
|
//Получаю число адаптеров
|
||||||
|
int count = collection.Cast<ManagementObject>()
|
||||||
|
.Select(static a => a.Properties["DeviceID"].Value.ToString()).Count();
|
||||||
|
|
||||||
|
//Перебираю массив данных
|
||||||
|
for (int ind = 0; ind < count; ind++)
|
||||||
|
{
|
||||||
|
//Создаю элемент информации об адаптере
|
||||||
|
OsDriveInfo drive = new()
|
||||||
|
{
|
||||||
|
Type = EDriveType.DtCDRom,
|
||||||
|
Caption = collection.Cast<ManagementObject>()
|
||||||
|
.Select(static a => a.Properties["Caption"].Value.ToString()).ElementAtOrDefault(ind),
|
||||||
|
Description = collection.Cast<ManagementObject>()
|
||||||
|
.Select(static a => a.Properties["Description"].Value.ToString()).ElementAtOrDefault(ind),
|
||||||
|
DeviceId = collection.Cast<ManagementObject>()
|
||||||
|
.Select(static a => a.Properties["DeviceID"].Value.ToString()).ElementAtOrDefault(ind),
|
||||||
|
Name = collection.Cast<ManagementObject>()
|
||||||
|
.Select(static a => a.Properties["Name"].Value.ToString()).ElementAtOrDefault(ind),
|
||||||
|
//Ставится 0, чтобы не проверять корректность загрузки и читаемость диска, а также избежать удлинения получения информации
|
||||||
|
TotalSize = 0,
|
||||||
|
Model = collection.Cast<ManagementObject>()
|
||||||
|
.Select(static a => a.Properties["Manufacturer"].Value.ToString()).ElementAtOrDefault(ind)
|
||||||
|
};
|
||||||
|
|
||||||
|
//Добавляю в список
|
||||||
|
driveList.Add(drive);
|
||||||
|
}
|
||||||
|
|
||||||
|
//Возвращаю список
|
||||||
|
return driveList;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Получаю информацию о сети интернет
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>Информация о сети интернет</returns>
|
||||||
|
private static List<IOsNetInfo> GetNet ()
|
||||||
|
{
|
||||||
|
//Создаю результирующий список
|
||||||
|
List<IOsNetInfo> netList = new();
|
||||||
|
|
||||||
|
//Получаю информацию о всех сетевых интерфейсах
|
||||||
|
foreach (NetworkInterface adapter in NetworkInterface.GetAllNetworkInterfaces())
|
||||||
|
{
|
||||||
|
//Создаю элемент
|
||||||
|
OsNetInfo netInfo = new()
|
||||||
|
{
|
||||||
|
Name = adapter.Name,
|
||||||
|
Description = adapter.Description,
|
||||||
|
MacAddress = adapter.OperationalStatus == OperationalStatus.Up ? adapter.GetPhysicalAddress().ToString() : null
|
||||||
|
};
|
||||||
|
|
||||||
|
//Получаю IP-адрес
|
||||||
|
foreach (UnicastIPAddressInformation info in adapter.GetIPProperties().UnicastAddresses.Where(static info =>
|
||||||
|
info.Address.AddressFamily == AddressFamily.InterNetwork && info.IsDnsEligible))
|
||||||
|
{
|
||||||
|
if (!string.IsNullOrWhiteSpace(netInfo.IPAddress))
|
||||||
|
netInfo.IPAddress += ";";
|
||||||
|
netInfo.IPAddress += info.Address.ToString();
|
||||||
|
}
|
||||||
|
|
||||||
|
//Добавляю адаптер
|
||||||
|
netList.Add(netInfo);
|
||||||
|
}
|
||||||
|
|
||||||
|
//Возвращаю список
|
||||||
|
return netList;
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
}
|
59
anbs_cp/Classes/OsInfos/OsDriveInfo.cs
Normal file
59
anbs_cp/Classes/OsInfos/OsDriveInfo.cs
Normal file
@ -0,0 +1,59 @@
|
|||||||
|
using anbs_cp.Enums;
|
||||||
|
using anbs_cp.Interfaces.OsInfos;
|
||||||
|
|
||||||
|
namespace anbs_cp.Classes.OsInfos;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Информация о дисках
|
||||||
|
/// </summary>
|
||||||
|
public class OsDriveInfo : IOsDriveInfo
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Конструктор
|
||||||
|
/// </summary>
|
||||||
|
public OsDriveInfo()
|
||||||
|
{
|
||||||
|
Type = EDriveType.DtHardDisc;
|
||||||
|
Caption = null;
|
||||||
|
Description = null;
|
||||||
|
DeviceId = null;
|
||||||
|
Name = null;
|
||||||
|
Model = null;
|
||||||
|
TotalSize = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Тип диска
|
||||||
|
/// </summary>
|
||||||
|
public EDriveType Type { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Заголовок
|
||||||
|
/// </summary>
|
||||||
|
public string? Caption { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Описание
|
||||||
|
/// </summary>
|
||||||
|
public string? Description { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Идентификатор устройства
|
||||||
|
/// </summary>
|
||||||
|
public string? DeviceId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Имя устройства
|
||||||
|
/// </summary>
|
||||||
|
public string? Name { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Модель
|
||||||
|
/// </summary>
|
||||||
|
public string? Model { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Общий размер
|
||||||
|
/// </summary>
|
||||||
|
public ulong TotalSize { get; set; }
|
||||||
|
}
|
39
anbs_cp/Classes/OsInfos/OsNetInfo.cs
Normal file
39
anbs_cp/Classes/OsInfos/OsNetInfo.cs
Normal file
@ -0,0 +1,39 @@
|
|||||||
|
using anbs_cp.Interfaces.OsInfos;
|
||||||
|
|
||||||
|
namespace anbs_cp.Classes.OsInfos;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Информация об интернет-соединении
|
||||||
|
/// </summary>
|
||||||
|
public sealed class OsNetInfo: IOsNetInfo
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Заголовок
|
||||||
|
/// </summary>
|
||||||
|
public string? Caption { get => Name; set => _ = value; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Описание
|
||||||
|
/// </summary>
|
||||||
|
public string? Description { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Идентификатор устройства
|
||||||
|
/// </summary>
|
||||||
|
public string? DeviceId { get => Name; set => _ = value; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Имя устройства
|
||||||
|
/// </summary>
|
||||||
|
public string? Name { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// IP-адрес
|
||||||
|
/// </summary>
|
||||||
|
public string? IPAddress { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// MAC-адрес
|
||||||
|
/// </summary>
|
||||||
|
public string? MacAddress { get; set; }
|
||||||
|
}
|
64
anbs_cp/Classes/OsInfos/OsProcessorInfo.cs
Normal file
64
anbs_cp/Classes/OsInfos/OsProcessorInfo.cs
Normal file
@ -0,0 +1,64 @@
|
|||||||
|
using anbs_cp.Interfaces.OsInfos;
|
||||||
|
|
||||||
|
namespace anbs_cp.Classes.OsInfos;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Класс информации о процессоре
|
||||||
|
/// </summary>
|
||||||
|
public sealed class OsProcessorInfo : IOsProcessorInfo
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Конструктор
|
||||||
|
/// </summary>
|
||||||
|
public OsProcessorInfo()
|
||||||
|
{
|
||||||
|
Caption = null;
|
||||||
|
Description = null;
|
||||||
|
DeviceId = null;
|
||||||
|
Manufacturer = null;
|
||||||
|
MaxClockSpeed = 0;
|
||||||
|
Name = null;
|
||||||
|
NumberOfCores = 0;
|
||||||
|
NumberOfLogicalProcessors = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Заголовок
|
||||||
|
/// </summary>
|
||||||
|
public string? Caption { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Описание
|
||||||
|
/// </summary>
|
||||||
|
public string? Description { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Идентификатор процессора в системе
|
||||||
|
/// </summary>
|
||||||
|
public string? DeviceId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Производитель
|
||||||
|
/// </summary>
|
||||||
|
public string? Manufacturer { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Максимальная тактовая частота
|
||||||
|
/// </summary>
|
||||||
|
public int MaxClockSpeed { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Имя процессора
|
||||||
|
/// </summary>
|
||||||
|
public string? Name { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Число ядер
|
||||||
|
/// </summary>
|
||||||
|
public int NumberOfCores { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Число потоков
|
||||||
|
/// </summary>
|
||||||
|
public int NumberOfLogicalProcessors { get; set; }
|
||||||
|
}
|
82
anbs_cp/Classes/OsInfos/OsVideoAdapterInfo.cs
Normal file
82
anbs_cp/Classes/OsInfos/OsVideoAdapterInfo.cs
Normal file
@ -0,0 +1,82 @@
|
|||||||
|
using anbs_cp.Interfaces.OsInfos;
|
||||||
|
|
||||||
|
namespace anbs_cp.Classes.OsInfos;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Информация о видеокарте
|
||||||
|
/// </summary>
|
||||||
|
internal sealed class OsVideoAdapterInfo : IOsVideoAdapterInfo
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Конструктор
|
||||||
|
/// </summary>
|
||||||
|
public OsVideoAdapterInfo()
|
||||||
|
{
|
||||||
|
AdapterRAM = 0;
|
||||||
|
Caption = null;
|
||||||
|
CurrentResolution = (0, 0);
|
||||||
|
Description = null;
|
||||||
|
DeviceId = null;
|
||||||
|
DriverDate = null;
|
||||||
|
DriverVersion = null;
|
||||||
|
InstalledDisplayDrivers = null;
|
||||||
|
Name = null;
|
||||||
|
SystemName = null;
|
||||||
|
VideoProcessor = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Память
|
||||||
|
/// </summary>
|
||||||
|
public int AdapterRAM { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Заголовок
|
||||||
|
/// </summary>
|
||||||
|
public string? Caption { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Текущее разрешение
|
||||||
|
/// </summary>
|
||||||
|
public (int, int) CurrentResolution { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Описание
|
||||||
|
/// </summary>
|
||||||
|
public string? Description { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Идентификатор устройства
|
||||||
|
/// </summary>
|
||||||
|
public string? DeviceId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Дата установки драйвера
|
||||||
|
/// </summary>
|
||||||
|
public string? DriverDate { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Версия драйвера
|
||||||
|
/// </summary>
|
||||||
|
public string? DriverVersion { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Название драйверов
|
||||||
|
/// </summary>
|
||||||
|
public string? InstalledDisplayDrivers { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Имя
|
||||||
|
/// </summary>
|
||||||
|
public string? Name { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Имя в системе
|
||||||
|
/// </summary>
|
||||||
|
public string? SystemName { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Видео процессор
|
||||||
|
/// </summary>
|
||||||
|
public string? VideoProcessor { get; set; }
|
||||||
|
}
|
62
anbs_cp/Classes/OsInfos/OsWindowsInfo.cs
Normal file
62
anbs_cp/Classes/OsInfos/OsWindowsInfo.cs
Normal file
@ -0,0 +1,62 @@
|
|||||||
|
using anbs_cp.Interfaces.OsInfos;
|
||||||
|
|
||||||
|
namespace anbs_cp.Classes.OsInfos;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Информация о Windows
|
||||||
|
/// </summary>
|
||||||
|
public sealed class OsWindowsInfo : IOsWindowsInfo
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Конструктор
|
||||||
|
///</summary>
|
||||||
|
public OsWindowsInfo()
|
||||||
|
{
|
||||||
|
Version = null;
|
||||||
|
Is64 = true;
|
||||||
|
PcName = null;
|
||||||
|
WindowsFolder = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Версия
|
||||||
|
/// </summary>
|
||||||
|
public string? Version { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 64-разрядная ОС
|
||||||
|
/// </summary>
|
||||||
|
public bool Is64 { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Имя компьютера
|
||||||
|
/// </summary>
|
||||||
|
public string? PcName { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Путь к папке Windows
|
||||||
|
/// </summary>
|
||||||
|
public string? WindowsFolder { get; set; }
|
||||||
|
|
||||||
|
#region Реализация интерфейса IBasicInfo
|
||||||
|
/// <summary>
|
||||||
|
/// Заголовок
|
||||||
|
/// </summary>
|
||||||
|
public string? Caption { get => Version; set => _= value; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Описание
|
||||||
|
/// </summary>
|
||||||
|
public string? Description { get => Version; set => _= value; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Идентификатор
|
||||||
|
/// </summary>
|
||||||
|
public string? DeviceId { get => Version; set => _= value; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Имя
|
||||||
|
/// </summary>
|
||||||
|
public string? Name { get => Version; set => _= value; }
|
||||||
|
#endregion
|
||||||
|
}
|
17
anbs_cp/Enums/EDriveType.cs
Normal file
17
anbs_cp/Enums/EDriveType.cs
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
namespace anbs_cp.Enums;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Тип носителя
|
||||||
|
/// </summary>
|
||||||
|
public enum EDriveType
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// HDD/SSD/M2
|
||||||
|
/// </summary>
|
||||||
|
DtHardDisc = 0,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Диск CD/DVD/BD
|
||||||
|
/// </summary>
|
||||||
|
DtCDRom = 1
|
||||||
|
}
|
27
anbs_cp/Interfaces/OsInfos/IOsBasicInfo.cs
Normal file
27
anbs_cp/Interfaces/OsInfos/IOsBasicInfo.cs
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
namespace anbs_cp.Interfaces.OsInfos;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Базовые параметры устройства
|
||||||
|
/// </summary>
|
||||||
|
public interface IOsBasicInfo
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Заголовок
|
||||||
|
/// </summary>
|
||||||
|
public string? Caption { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Описание
|
||||||
|
/// </summary>
|
||||||
|
public string? Description { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Идентификатор устройства
|
||||||
|
/// </summary>
|
||||||
|
public string? DeviceId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Имя устройства
|
||||||
|
/// </summary>
|
||||||
|
public string? Name { get; set; }
|
||||||
|
}
|
24
anbs_cp/Interfaces/OsInfos/IOsDriveInfo.cs
Normal file
24
anbs_cp/Interfaces/OsInfos/IOsDriveInfo.cs
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
using anbs_cp.Enums;
|
||||||
|
|
||||||
|
namespace anbs_cp.Interfaces.OsInfos;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Информация о дисках
|
||||||
|
/// </summary>
|
||||||
|
public interface IOsDriveInfo : IOsBasicInfo
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Тип диска
|
||||||
|
/// </summary>
|
||||||
|
public EDriveType Type { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Модель
|
||||||
|
/// </summary>
|
||||||
|
public string? Model { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Общий размер
|
||||||
|
/// </summary>
|
||||||
|
public ulong TotalSize { get; set; }
|
||||||
|
}
|
17
anbs_cp/Interfaces/OsInfos/IOsNetInfo.cs
Normal file
17
anbs_cp/Interfaces/OsInfos/IOsNetInfo.cs
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
namespace anbs_cp.Interfaces.OsInfos;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Информация об интернет-соединении
|
||||||
|
/// </summary>
|
||||||
|
public interface IOsNetInfo: IOsBasicInfo
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// IP-адрес
|
||||||
|
/// </summary>
|
||||||
|
public string? IPAddress { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// MAC-адрес
|
||||||
|
/// </summary>
|
||||||
|
public string? MacAddress { get; set; }
|
||||||
|
}
|
31
anbs_cp/Interfaces/OsInfos/IOsProcessorInfo.cs
Normal file
31
anbs_cp/Interfaces/OsInfos/IOsProcessorInfo.cs
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
namespace anbs_cp.Interfaces.OsInfos;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Информация о процессоре
|
||||||
|
/// </summary>
|
||||||
|
public interface IOsProcessorInfo : IOsBasicInfo
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Заголовок
|
||||||
|
/// </summary>
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Производитель
|
||||||
|
/// </summary>
|
||||||
|
public string? Manufacturer { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Максимальная тактовая частота
|
||||||
|
/// </summary>
|
||||||
|
public int MaxClockSpeed { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Число ядер
|
||||||
|
/// </summary>
|
||||||
|
public int NumberOfCores { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Число потоков
|
||||||
|
/// </summary>
|
||||||
|
public int NumberOfLogicalProcessors { get; set; }
|
||||||
|
}
|
42
anbs_cp/Interfaces/OsInfos/IOsVideoAdapterInfo.cs
Normal file
42
anbs_cp/Interfaces/OsInfos/IOsVideoAdapterInfo.cs
Normal file
@ -0,0 +1,42 @@
|
|||||||
|
namespace anbs_cp.Interfaces.OsInfos;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Информация о видеокарте
|
||||||
|
/// </summary>
|
||||||
|
public interface IOsVideoAdapterInfo : IOsBasicInfo
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Память
|
||||||
|
/// </summary>
|
||||||
|
public int AdapterRAM { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Текущее разрешение
|
||||||
|
/// </summary>
|
||||||
|
public (int, int) CurrentResolution { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Дата установки драйвера
|
||||||
|
/// </summary>
|
||||||
|
public string? DriverDate { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Версия драйвера
|
||||||
|
/// </summary>
|
||||||
|
public string? DriverVersion { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Название драйверов
|
||||||
|
/// </summary>
|
||||||
|
public string? InstalledDisplayDrivers { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Имя в системе
|
||||||
|
/// </summary>
|
||||||
|
public string? SystemName { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Видео процессор
|
||||||
|
/// </summary>
|
||||||
|
public string? VideoProcessor { get; set; }
|
||||||
|
}
|
27
anbs_cp/Interfaces/OsInfos/IOsWindowsInfo.cs
Normal file
27
anbs_cp/Interfaces/OsInfos/IOsWindowsInfo.cs
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
namespace anbs_cp.Interfaces.OsInfos;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Информация о Windows
|
||||||
|
/// </summary>
|
||||||
|
public interface IOsWindowsInfo: IOsBasicInfo
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Версия
|
||||||
|
/// </summary>
|
||||||
|
public string? Version { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 64-разрядная ОС
|
||||||
|
/// </summary>
|
||||||
|
public bool Is64 { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Имя компьютера
|
||||||
|
/// </summary>
|
||||||
|
public string? PcName { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Путь к папке Windows
|
||||||
|
/// </summary>
|
||||||
|
public string? WindowsFolder { get; set; }
|
||||||
|
}
|
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>net7.0</TargetFramework>
|
<TargetFramework>net7.0</TargetFramework>
|
||||||
<Version>2023.104.1</Version>
|
<Version>2023.115.0</Version>
|
||||||
<Authors>Alexander Babaev</Authors>
|
<Authors>Alexander Babaev</Authors>
|
||||||
<Product>ANB Software Components Pack</Product>
|
<Product>ANB Software Components Pack</Product>
|
||||||
<Description>Library of some useful functions in C# language.</Description>
|
<Description>Library of some useful functions in C# language.</Description>
|
||||||
@ -15,8 +15,8 @@
|
|||||||
<SignAssembly>True</SignAssembly>
|
<SignAssembly>True</SignAssembly>
|
||||||
<PackageProjectUrl>https://git.babaev-an.ru/babaev-an/anbsoftware_componentspack</PackageProjectUrl>
|
<PackageProjectUrl>https://git.babaev-an.ru/babaev-an/anbsoftware_componentspack</PackageProjectUrl>
|
||||||
<RepositoryUrl>https://git.babaev-an.ru/babaev-an/anbsoftware_componentspack</RepositoryUrl>
|
<RepositoryUrl>https://git.babaev-an.ru/babaev-an/anbsoftware_componentspack</RepositoryUrl>
|
||||||
<AssemblyVersion>2023.104.1</AssemblyVersion>
|
<AssemblyVersion>2023.115.0</AssemblyVersion>
|
||||||
<FileVersion>2023.104.1</FileVersion>
|
<FileVersion>2023.115.0</FileVersion>
|
||||||
<PackageId>ANBSoftware.ComponentsPack</PackageId>
|
<PackageId>ANBSoftware.ComponentsPack</PackageId>
|
||||||
<PackageLicenseExpression>MIT</PackageLicenseExpression>
|
<PackageLicenseExpression>MIT</PackageLicenseExpression>
|
||||||
<AnalysisLevel>6.0</AnalysisLevel>
|
<AnalysisLevel>6.0</AnalysisLevel>
|
||||||
@ -40,6 +40,7 @@
|
|||||||
<PackageReference Include="Microsoft.AspNetCore.Html.Abstractions" Version="2.2.0" />
|
<PackageReference Include="Microsoft.AspNetCore.Html.Abstractions" Version="2.2.0" />
|
||||||
<PackageReference Include="Microsoft.AspNetCore.Http.Features" Version="5.0.17" />
|
<PackageReference Include="Microsoft.AspNetCore.Http.Features" Version="5.0.17" />
|
||||||
<PackageReference Include="Microsoft.VisualStudio.Shell.Interop" Version="17.4.33103.184" />
|
<PackageReference Include="Microsoft.VisualStudio.Shell.Interop" Version="17.4.33103.184" />
|
||||||
|
<PackageReference Include="Microsoft.Windows.Compatibility" Version="7.0.0" />
|
||||||
<PackageReference Include="MimeTypes" Version="2.4.0">
|
<PackageReference Include="MimeTypes" Version="2.4.0">
|
||||||
<PrivateAssets>all</PrivateAssets>
|
<PrivateAssets>all</PrivateAssets>
|
||||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||||
@ -47,4 +48,8 @@
|
|||||||
<PackageReference Include="System.Text.Encodings.Web" Version="7.0.0" />
|
<PackageReference Include="System.Text.Encodings.Web" Version="7.0.0" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<Folder Include="Enums\" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
|
@ -1,9 +1,16 @@
|
|||||||
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
|
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
|
||||||
|
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=CD/@EntryIndexedValue">CD</s:String>
|
||||||
|
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=HD/@EntryIndexedValue">HD</s:String>
|
||||||
|
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=HDD/@EntryIndexedValue">HDD</s:String>
|
||||||
|
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=RA/@EntryIndexedValue">RA</s:String>
|
||||||
|
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=RAM/@EntryIndexedValue">RAM</s:String>
|
||||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=anbs/@EntryIndexedValue">True</s:Boolean>
|
<s:Boolean x:Key="/Default/UserDictionary/Words/=anbs/@EntryIndexedValue">True</s:Boolean>
|
||||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=_0412_0435_0440_043D_0451_043C/@EntryIndexedValue">True</s:Boolean>
|
<s:Boolean x:Key="/Default/UserDictionary/Words/=_0412_0435_0440_043D_0451_043C/@EntryIndexedValue">True</s:Boolean>
|
||||||
|
<s:Boolean x:Key="/Default/UserDictionary/Words/=_0412_0438_0434_0435_043E_043A_0430_0440_0442_0430/@EntryIndexedValue">True</s:Boolean>
|
||||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=_041F_0430_0440_0441_0435_0440/@EntryIndexedValue">True</s:Boolean>
|
<s:Boolean x:Key="/Default/UserDictionary/Words/=_041F_0430_0440_0441_0435_0440/@EntryIndexedValue">True</s:Boolean>
|
||||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=_0421_043E_0437_0434_0430_0451_043C/@EntryIndexedValue">True</s:Boolean>
|
<s:Boolean x:Key="/Default/UserDictionary/Words/=_0421_043E_0437_0434_0430_0451_043C/@EntryIndexedValue">True</s:Boolean>
|
||||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=_0432_0432_0435_0434_0451_043D/@EntryIndexedValue">True</s:Boolean>
|
<s:Boolean x:Key="/Default/UserDictionary/Words/=_0432_0432_0435_0434_0451_043D/@EntryIndexedValue">True</s:Boolean>
|
||||||
|
<s:Boolean x:Key="/Default/UserDictionary/Words/=_0432_0438_0434_0435_043E_043A_0430_0440_0442_0435/@EntryIndexedValue">True</s:Boolean>
|
||||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=_0438_043C_0451_043D/@EntryIndexedValue">True</s:Boolean>
|
<s:Boolean x:Key="/Default/UserDictionary/Words/=_0438_043C_0451_043D/@EntryIndexedValue">True</s:Boolean>
|
||||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=_0441_0447_0451_0442/@EntryIndexedValue">True</s:Boolean>
|
<s:Boolean x:Key="/Default/UserDictionary/Words/=_0441_0447_0451_0442/@EntryIndexedValue">True</s:Boolean>
|
||||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=_0441_0447_0451_0442_0447_0438_043A/@EntryIndexedValue">True</s:Boolean>
|
<s:Boolean x:Key="/Default/UserDictionary/Words/=_0441_0447_0451_0442_0447_0438_043A/@EntryIndexedValue">True</s:Boolean>
|
||||||
|
13
demo/MainMenu.Designer.cs
generated
13
demo/MainMenu.Designer.cs
generated
@ -31,6 +31,7 @@ sealed partial class MainMenu
|
|||||||
this.CountValueTest = new System.Windows.Forms.Button();
|
this.CountValueTest = new System.Windows.Forms.Button();
|
||||||
this.SimpleMapperTest = new System.Windows.Forms.Button();
|
this.SimpleMapperTest = new System.Windows.Forms.Button();
|
||||||
this.FileExtensionTest = new System.Windows.Forms.Button();
|
this.FileExtensionTest = new System.Windows.Forms.Button();
|
||||||
|
this.OsInfoBtn = new System.Windows.Forms.Button();
|
||||||
this.SuspendLayout();
|
this.SuspendLayout();
|
||||||
//
|
//
|
||||||
// CountValueTest
|
// CountValueTest
|
||||||
@ -63,11 +64,22 @@ sealed partial class MainMenu
|
|||||||
this.FileExtensionTest.UseVisualStyleBackColor = true;
|
this.FileExtensionTest.UseVisualStyleBackColor = true;
|
||||||
this.FileExtensionTest.Click += new System.EventHandler(this.FileExtensionTest_Click);
|
this.FileExtensionTest.Click += new System.EventHandler(this.FileExtensionTest_Click);
|
||||||
//
|
//
|
||||||
|
// OsInfoBtn
|
||||||
|
//
|
||||||
|
this.OsInfoBtn.Location = new System.Drawing.Point(12, 185);
|
||||||
|
this.OsInfoBtn.Name = "OsInfoBtn";
|
||||||
|
this.OsInfoBtn.Size = new System.Drawing.Size(335, 51);
|
||||||
|
this.OsInfoBtn.TabIndex = 3;
|
||||||
|
this.OsInfoBtn.Text = "Информация о системе";
|
||||||
|
this.OsInfoBtn.UseVisualStyleBackColor = true;
|
||||||
|
this.OsInfoBtn.Click += new System.EventHandler(this.OsInfoBtn_Click);
|
||||||
|
//
|
||||||
// MainMenu
|
// MainMenu
|
||||||
//
|
//
|
||||||
this.AutoScaleDimensions = new System.Drawing.SizeF(10F, 21F);
|
this.AutoScaleDimensions = new System.Drawing.SizeF(10F, 21F);
|
||||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||||
this.ClientSize = new System.Drawing.Size(361, 252);
|
this.ClientSize = new System.Drawing.Size(361, 252);
|
||||||
|
this.Controls.Add(this.OsInfoBtn);
|
||||||
this.Controls.Add(this.FileExtensionTest);
|
this.Controls.Add(this.FileExtensionTest);
|
||||||
this.Controls.Add(this.SimpleMapperTest);
|
this.Controls.Add(this.SimpleMapperTest);
|
||||||
this.Controls.Add(this.CountValueTest);
|
this.Controls.Add(this.CountValueTest);
|
||||||
@ -86,4 +98,5 @@ sealed partial class MainMenu
|
|||||||
private Button CountValueTest;
|
private Button CountValueTest;
|
||||||
private Button SimpleMapperTest;
|
private Button SimpleMapperTest;
|
||||||
private Button FileExtensionTest;
|
private Button FileExtensionTest;
|
||||||
|
private Button OsInfoBtn;
|
||||||
}
|
}
|
||||||
|
@ -23,4 +23,10 @@ public sealed partial class MainMenu: Form
|
|||||||
FileHashAndMimeType formTest = new();
|
FileHashAndMimeType formTest = new();
|
||||||
formTest.ShowDialog();
|
formTest.ShowDialog();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void OsInfoBtn_Click (object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
OsInfoFrm formTest = new();
|
||||||
|
formTest.ShowDialog();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
65
demo/OsInfoFrm.Designer.cs
generated
Normal file
65
demo/OsInfoFrm.Designer.cs
generated
Normal file
@ -0,0 +1,65 @@
|
|||||||
|
namespace demo;
|
||||||
|
|
||||||
|
sealed partial class OsInfoFrm
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Required designer variable.
|
||||||
|
/// </summary>
|
||||||
|
private System.ComponentModel.IContainer components = null;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Clean up any resources being used.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||||
|
protected override void Dispose (bool disposing)
|
||||||
|
{
|
||||||
|
if (disposing && (components != null))
|
||||||
|
{
|
||||||
|
components.Dispose();
|
||||||
|
}
|
||||||
|
base.Dispose(disposing);
|
||||||
|
}
|
||||||
|
|
||||||
|
#region Windows Form Designer generated code
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Required method for Designer support - do not modify
|
||||||
|
/// the contents of this method with the code editor.
|
||||||
|
/// </summary>
|
||||||
|
private void InitializeComponent ()
|
||||||
|
{
|
||||||
|
this.textBox = new System.Windows.Forms.TextBox();
|
||||||
|
this.SuspendLayout();
|
||||||
|
//
|
||||||
|
// textBox
|
||||||
|
//
|
||||||
|
this.textBox.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||||
|
this.textBox.Location = new System.Drawing.Point(0, 0);
|
||||||
|
this.textBox.Multiline = true;
|
||||||
|
this.textBox.Name = "textBox";
|
||||||
|
this.textBox.Size = new System.Drawing.Size(1029, 510);
|
||||||
|
this.textBox.TabIndex = 0;
|
||||||
|
//
|
||||||
|
// OsInfoFrm
|
||||||
|
//
|
||||||
|
this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 17F);
|
||||||
|
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||||
|
this.ClientSize = new System.Drawing.Size(1029, 510);
|
||||||
|
this.Controls.Add(this.textBox);
|
||||||
|
this.Font = new System.Drawing.Font("Courier New", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
|
||||||
|
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.Fixed3D;
|
||||||
|
this.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
|
||||||
|
this.MaximizeBox = false;
|
||||||
|
this.MinimizeBox = false;
|
||||||
|
this.Name = "OsInfoFrm";
|
||||||
|
this.Text = "Информация о системе";
|
||||||
|
this.Load += new System.EventHandler(this.OsInfoFrm_Load);
|
||||||
|
this.ResumeLayout(false);
|
||||||
|
this.PerformLayout();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
private TextBox textBox;
|
||||||
|
}
|
28
demo/OsInfoFrm.cs
Normal file
28
demo/OsInfoFrm.cs
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
using anbs_cp.Classes;
|
||||||
|
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
|
||||||
|
namespace demo;
|
||||||
|
public sealed partial class OsInfoFrm: Form
|
||||||
|
{
|
||||||
|
public OsInfoFrm ()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void OsInfoFrm_Load (object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
textBox.Text = @"Процессор(ы) | ";
|
||||||
|
textBox.Text += JsonConvert.SerializeObject(OsInfo.Processors);
|
||||||
|
textBox.Text += @"Оперативная память | ";
|
||||||
|
textBox.Text += JsonConvert.SerializeObject(OsInfo.RAM);
|
||||||
|
textBox.Text += @"Видеокарта | ";
|
||||||
|
textBox.Text += JsonConvert.SerializeObject(OsInfo.Videos);
|
||||||
|
textBox.Text += @"Диски | ";
|
||||||
|
textBox.Text += JsonConvert.SerializeObject(OsInfo.Drives);
|
||||||
|
textBox.Text += @"Windows | ";
|
||||||
|
textBox.Text += JsonConvert.SerializeObject(OsInfo.Windows);
|
||||||
|
textBox.Text += @"Net | ";
|
||||||
|
textBox.Text += JsonConvert.SerializeObject(OsInfo.Net);
|
||||||
|
}
|
||||||
|
}
|
60
demo/OsInfoFrm.resx
Normal file
60
demo/OsInfoFrm.resx
Normal file
@ -0,0 +1,60 @@
|
|||||||
|
<root>
|
||||||
|
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||||
|
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||||
|
<xsd:element name="root" msdata:IsDataSet="true">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:choice maxOccurs="unbounded">
|
||||||
|
<xsd:element name="metadata">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||||
|
<xsd:attribute name="type" type="xsd:string" />
|
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||||
|
<xsd:attribute ref="xml:space" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="assembly">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:attribute name="alias" type="xsd:string" />
|
||||||
|
<xsd:attribute name="name" type="xsd:string" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="data">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||||
|
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||||
|
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||||
|
<xsd:attribute ref="xml:space" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="resheader">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
</xsd:choice>
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
</xsd:schema>
|
||||||
|
<resheader name="resmimetype">
|
||||||
|
<value>text/microsoft-resx</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="version">
|
||||||
|
<value>2.0</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="reader">
|
||||||
|
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="writer">
|
||||||
|
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
</root>
|
Loading…
x
Reference in New Issue
Block a user