From d82c533e5b8b1670d3463abf3c6a7a22dfe7a17f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E7=99=BD=E7=8C=BF?= <1083092844@qq.com> Date: Mon, 24 Apr 2023 22:11:44 +0800 Subject: [PATCH] =?UTF-8?q?=E8=8E=B7=E5=8F=96=E8=BF=9B=E7=A8=8B=E5=90=8D?= =?UTF-8?q?=E7=9A=84=E5=BC=82=E5=B8=B8=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- BarrageGrab/Proxy/SystemProxy.cs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/BarrageGrab/Proxy/SystemProxy.cs b/BarrageGrab/Proxy/SystemProxy.cs index 917e8ff..3bdd2e8 100644 --- a/BarrageGrab/Proxy/SystemProxy.cs +++ b/BarrageGrab/Proxy/SystemProxy.cs @@ -79,11 +79,15 @@ namespace BarrageGrab.Proxy /// protected string GetProcessName(int processID) { - var process = Process.GetProcessById(processID); - if (process != null) + try { - return process.ProcessName; + var process = Process.GetProcessById(processID); + if (process != null) + { + return process.ProcessName; + } } + catch (Exception ex){} return $"<{processID}>"; }