@page "/TestHwInfo" @using DeviceId @using EgwCoreLib.Utils @if (isLoading) { } else {
@if (ListUserInfo != null && ListUserInfo.Count > 0) { } @if (ListNetInfo != null && ListNetInfo.Count > 0) {
}


} @code { protected Dictionary ListAllMacInfo { get; set; } = new Dictionary(); protected Dictionary ListCpuInfo { get; set; } = new Dictionary(); protected Dictionary ListDevId { get; set; } = new Dictionary(); protected Dictionary ListNetInfo { get; set; } = new Dictionary(); protected Dictionary ListOsInfo { get; set; } = new Dictionary(); protected Dictionary ListUserInfo { get; set; } = new Dictionary(); protected Dictionary ListVolInfo { get; set; } = new Dictionary(); protected MachineDataValidator MDValidator { get; set; } = new MachineDataValidator(); protected SubLicManager SubLicManager { get; set; } = new SubLicManager(); protected string codImpiego = ""; protected string appKey = ""; protected string decVal = ""; private bool isLoading { get; set; } = true; protected override async Task OnInitializedAsync() { isLoading = true; await InvokeAsync(StateHasChanged); await Task.Run(() => { GetInfo(); }); Regenerate(); isLoading = false; await InvokeAsync(StateHasChanged); } protected void GetInfo() { string deviceId = ""; deviceId = new DeviceIdBuilder() .OnWindows(windows => windows.AddWindowsDeviceId()) .ToString(); ListDevId.Add("DevId_01", deviceId); deviceId = new DeviceIdBuilder() .AddMachineName() .AddOsVersion() // .AddFileToken("machine.uid") .ToString(); ListDevId.Add("DevId_02", deviceId); deviceId = new DeviceIdBuilder() .AddMachineName() .AddUserName() .AddOsVersion() .OnWindows(windows => windows .AddMacAddressFromWmi(excludeWireless: true, excludeNonPhysical: true) .AddProcessorId() .AddMotherboardSerialNumber() .AddSystemDriveSerialNumber()) // .OnLinux(linux => linux // .AddMotherboardSerialNumber() // .AddSystemDriveSerialNumber()) // .OnMac(mac => mac // .AddSystemDriveSerialNumber() // .AddPlatformSerialNumber()) .ToString(); ListDevId.Add("DevId_03", deviceId); ListNetInfo = new Dictionary(MachineDataValidator.netInfo); ListOsInfo = new Dictionary(MachineDataValidator.osInfo); ListUserInfo = new Dictionary(MachineDataValidator.userInfo); ListCpuInfo = new Dictionary(MachineDataValidator.cpuInfo); ListVolInfo = new Dictionary(MachineDataValidator.volInfo); ListAllMacInfo = new Dictionary(MachineDataValidator.userInfo); foreach (var item in MachineDataValidator.netInfo) { if (!ListAllMacInfo.ContainsKey(item.Key)) { ListAllMacInfo.Add(item.Key, item.Value); } } } protected void Regenerate() { isLoading = true; codImpiego = SubLicManager.CodImpiego(); appKey = SubLicManager.GenKey(passphrase, false); decVal = SteamCrypto.DecryptString(appKey, passphrase); isLoading = false; } private string passphrase = "SaltPass"; }