From 7becd1bb21144e7d5a64e950898bddcea2f6fada Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A4=A7=E7=9F=B3=E5=A4=B4?= Date: Sat, 9 Sep 2023 07:19:15 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3Remoting=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ClientTest/ClientTest.csproj | 4 ++-- Stardust.ServerTests/Stardust.ServerTests.csproj | 2 +- Stardust/LocalStarClient.cs | 10 ---------- Stardust/Models/AppInfo.cs | 4 ---- Stardust/StarClient.cs | 2 -- Stardust/Stardust.csproj | 6 +++--- Test/Test.csproj | 2 +- 7 files changed, 7 insertions(+), 23 deletions(-) diff --git a/ClientTest/ClientTest.csproj b/ClientTest/ClientTest.csproj index 1df0586a..59eb01f8 100644 --- a/ClientTest/ClientTest.csproj +++ b/ClientTest/ClientTest.csproj @@ -20,9 +20,9 @@ - + - + all diff --git a/Stardust.ServerTests/Stardust.ServerTests.csproj b/Stardust.ServerTests/Stardust.ServerTests.csproj index 1a6e4fa3..1b2a7ffd 100644 --- a/Stardust.ServerTests/Stardust.ServerTests.csproj +++ b/Stardust.ServerTests/Stardust.ServerTests.csproj @@ -21,7 +21,7 @@ - + diff --git a/Stardust/LocalStarClient.cs b/Stardust/LocalStarClient.cs index fc83b528..066d644e 100644 --- a/Stardust/LocalStarClient.cs +++ b/Stardust/LocalStarClient.cs @@ -447,15 +447,6 @@ public static IEnumerable Scan(AgentInfo local = null, Int32 timeout var rs = new DefaultMessage(); IPEndPoint ep = null; buf = udp.Receive(ref ep); -#if NET40 - if (buf != null && rs.Read(buf) && encoder.Decode(rs, out var action, out _, out var data)) - { - var js = encoder.DecodeResult(action, data, rs); - var info = (AgentInfo)encoder.Convert(js, typeof(AgentInfo)); - - yield return info; - } -#else if (buf != null && rs.Read(buf)) { var msg = encoder.Decode(rs); @@ -467,7 +458,6 @@ public static IEnumerable Scan(AgentInfo local = null, Int32 timeout yield return info; } } -#endif } } #endregion diff --git a/Stardust/Models/AppInfo.cs b/Stardust/Models/AppInfo.cs index 96c7ecda..7e80351f 100644 --- a/Stardust/Models/AppInfo.cs +++ b/Stardust/Models/AppInfo.cs @@ -132,11 +132,7 @@ public void Refresh() try { // 调用WindowApi获取进程的连接数 -#if NET40 - var tcps = NetHelper.GetAllTcpConnections(); -#else var tcps = NetHelper.GetAllTcpConnections(-1); -#endif if (tcps != null && tcps.Length > 0) { Connections = tcps.Count(e => e.ProcessId == Id); diff --git a/Stardust/StarClient.cs b/Stardust/StarClient.cs index 9926d4a8..7f5edf21 100644 --- a/Stardust/StarClient.cs +++ b/Stardust/StarClient.cs @@ -221,9 +221,7 @@ public NodeInfo GetNodeInfo() DriveInfo = drives.Join(",", e => $"{e.Name}[{e.DriveFormat}]={e.AvailableFreeSpace.ToGMK()}/{e.TotalSize.ToGMK()}"), Product = mi.Product, -#if !NET40 Vendor = mi.Vendor, -#endif Processor = mi.Processor, CpuRate = mi.CpuRate, UUID = mi.UUID, diff --git a/Stardust/Stardust.csproj b/Stardust/Stardust.csproj index de851bd2..f58f3466 100644 --- a/Stardust/Stardust.csproj +++ b/Stardust/Stardust.csproj @@ -86,11 +86,11 @@ - - + + - + diff --git a/Test/Test.csproj b/Test/Test.csproj index f1507bbd..54e56b67 100644 --- a/Test/Test.csproj +++ b/Test/Test.csproj @@ -25,7 +25,7 @@ - +