更新bug

This commit is contained in:
少年郎秃头呀
2024-02-17 21:38:53 +08:00
parent af2cca0a3e
commit e9d07db1ba
3 changed files with 24 additions and 15 deletions

View File

@@ -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>();

View File

@@ -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);

View File

@@ -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 });