mirror of
https://github.com/snltty/linker.git
synced 2025-11-01 21:13:04 +08:00
更新bug
This commit is contained in:
@@ -40,6 +40,7 @@ using cmonitor.client.reports.wallpaper;
|
||||
using cmonitor.client.reports.snatch;
|
||||
using cmonitor.service.messengers.snatch;
|
||||
using cmonitor.libs;
|
||||
using common.libs.winapis;
|
||||
|
||||
|
||||
namespace cmonitor
|
||||
@@ -58,12 +59,6 @@ namespace cmonitor
|
||||
//日志输出
|
||||
LoggerConsole();
|
||||
|
||||
/*
|
||||
foreach (var arg in Dns.GetHostByName(Dns.GetHostName()).AddressList)
|
||||
{
|
||||
Console.WriteLine(arg.Address.ToString());
|
||||
}*/
|
||||
|
||||
//读取参数
|
||||
Dictionary<string, string> dic = ArgumentParser.Parse(args, out string error);
|
||||
#if RELEASE
|
||||
@@ -223,6 +218,9 @@ namespace cmonitor
|
||||
else if (OperatingSystem.IsLinux()) serviceCollection.AddSingleton<ISnatch, SnatchLinux>();
|
||||
else if (OperatingSystem.IsMacOS()) serviceCollection.AddSingleton<ISnatch, SnatchMacOS>();
|
||||
|
||||
|
||||
|
||||
serviceCollection.AddSingleton<WlanReport>();
|
||||
serviceCollection.AddSingleton<ShareReport>();
|
||||
|
||||
serviceCollection.AddSingleton<CommandReport>();
|
||||
|
||||
@@ -69,7 +69,7 @@ namespace cmonitor.client
|
||||
try
|
||||
{
|
||||
IPEndPoint remote = new IPEndPoint(ip, config.ServicePort);
|
||||
|
||||
//Logger.Instance.Info($"connect server {remote}");
|
||||
Socket socket = new Socket(ip.AddressFamily, SocketType.Stream, ProtocolType.Tcp);
|
||||
socket.KeepAlive();
|
||||
IAsyncResult result = socket.BeginConnect(remote, null, null);
|
||||
|
||||
@@ -24,12 +24,23 @@ namespace cmonitor.client.reports.system
|
||||
|
||||
public ReportDriveInfo[] GetAllDrives()
|
||||
{
|
||||
return DriveInfo.GetDrives().Select(c => new ReportDriveInfo
|
||||
List<ReportDriveInfo> result = new List<ReportDriveInfo>();
|
||||
foreach (DriveInfo item in DriveInfo.GetDrives())
|
||||
{
|
||||
Name = c.Name,
|
||||
Free = c.TotalFreeSpace,
|
||||
Total = c.TotalSize
|
||||
}).ToArray();
|
||||
try
|
||||
{
|
||||
result.Add(new ReportDriveInfo
|
||||
{
|
||||
Name = item.Name,
|
||||
Free = item.TotalFreeSpace,
|
||||
Total = item.TotalSize
|
||||
});
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
}
|
||||
}
|
||||
return result.ToArray();
|
||||
}
|
||||
|
||||
bool restored = false;
|
||||
@@ -58,9 +69,9 @@ namespace cmonitor.client.reports.system
|
||||
Task.Run(async () =>
|
||||
{
|
||||
Logger.Instance.Info($"regedit reuse");
|
||||
while ( reused == false)
|
||||
while (reused == false)
|
||||
{
|
||||
if(restored )
|
||||
if (restored)
|
||||
{
|
||||
reused |= registryOptionHelper.Reuse();
|
||||
OptionUpdate(new SystemOptionUpdateInfo { Keys = new string[] { "SoftwareSASGeneration" }, Value = false });
|
||||
|
||||
Reference in New Issue
Block a user