321a7091c6
- machine info - inclusione librerie x DeviceId - Generatore CodImpiego + Key x machines
119 lines
3.9 KiB
Plaintext
119 lines
3.9 KiB
Plaintext
@page "/TestHwInfo"
|
|
@using DeviceId
|
|
@using EgwCoreLib.Utils
|
|
|
|
|
|
<div class="row small">
|
|
<div class="col-6">
|
|
<ul class="list-group">
|
|
<li class="list-group-item active">
|
|
Device ID
|
|
</li>
|
|
@if (ListDevId != null && ListDevId.Count > 0)
|
|
{
|
|
@foreach (var item in ListDevId)
|
|
{
|
|
<li class="list-group-item d-flex justify-content-between">
|
|
<div class="px-1">@item.Key</div>
|
|
<div class="px-1">@item.Value</div>
|
|
</li>
|
|
}
|
|
}
|
|
</ul>
|
|
<hr />
|
|
|
|
<ul class="list-group">
|
|
<li class="list-group-item active">
|
|
Sublicense
|
|
</li>
|
|
<li class="list-group-item d-flex justify-content-between">
|
|
<div class="px-1">CodImpiego</div>
|
|
<div class="px-1">@codImpiego</div>
|
|
</li>
|
|
<li class="list-group-item d-flex justify-content-between">
|
|
<div class="px-1">AppKey</div>
|
|
<div class="px-1">@appKey</div>
|
|
</li>
|
|
<li>
|
|
<button class="btn btn-primary" @onclick="Regenerate">ReGen</button>
|
|
</li>
|
|
</ul>
|
|
</div>
|
|
<div class="col-6">
|
|
<ul class="list-group">
|
|
<li class="list-group-item active">
|
|
Machine Info
|
|
</li>
|
|
@if (ListMachineInfo != null && ListMachineInfo.Count > 0)
|
|
{
|
|
@foreach (var item in ListMachineInfo)
|
|
{
|
|
<li class="list-group-item d-flex justify-content-between">
|
|
<div class="px-1">@item.Key</div>
|
|
<div class="px-1">@item.Value</div>
|
|
</li>
|
|
}
|
|
}
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
@code {
|
|
protected Dictionary<string, string> ListDevId { get; set; } = new Dictionary<string, string>();
|
|
protected Dictionary<string, string> ListMachineInfo { get; set; } = new Dictionary<string, string>();
|
|
|
|
protected MachineDataValidator MDValidator { get; set; } = new MachineDataValidator();
|
|
|
|
protected SubLicManager SubLicManager { get; set; } = new SubLicManager();
|
|
|
|
protected string codImpiego = "";
|
|
protected string appKey = "";
|
|
|
|
protected override void OnInitialized()
|
|
{
|
|
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())
|
|
.ToString();
|
|
ListDevId.Add("DevId_03", deviceId);
|
|
|
|
ListMachineInfo = MachineDataValidator.userInfo;
|
|
foreach (var item in MachineDataValidator.netInfo)
|
|
{
|
|
if (!ListMachineInfo.ContainsKey(item.Key))
|
|
{
|
|
ListMachineInfo.Add(item.Key, item.Value);
|
|
}
|
|
}
|
|
|
|
Regenerate();
|
|
}
|
|
|
|
protected void Regenerate()
|
|
{
|
|
codImpiego = SubLicManager.CodImpiego();
|
|
appKey = SubLicManager.GenKey(passphrase);
|
|
}
|
|
|
|
private string passphrase = "SaltPass";
|
|
} |