Skip to content

Commit

Permalink
获取进程名的异常处理
Browse files Browse the repository at this point in the history
  • Loading branch information
ape-byte committed Apr 24, 2023
1 parent 86209c9 commit d82c533
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions BarrageGrab/Proxy/SystemProxy.cs
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,15 @@ protected void FireOnResponse(HttpResponseEventArgs args)
/// <returns></returns>
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}>";
}

Expand Down

0 comments on commit d82c533

Please sign in to comment.