public static string GetFilePath( this DotNetProcess process) { if (process == null) { throw new ArgumentNullException(nameof(process)); } var result = process.GetProcessMainModule().FileName; return(result); }
public static string GetName( this DotNetProcess process) { if (process == null) { throw new ArgumentNullException(nameof(process)); } var result = process.ProcessName; return(result); }
public static string GetProductVersion( this DotNetProcess process) { if (process == null) { throw new ArgumentNullException(nameof(process)); } var result = process.GetProcessMainModule().FileVersionInfo.ProductVersion; return(result); }
private static ProcessModule GetProcessMainModule( this DotNetProcess process) { if (process == null) { throw new ArgumentNullException(nameof(process)); } var result = process.MainModule; if (result == null) { throw new ArgumentNullException(Invariant($"{nameof(process)}.{nameof(result)}")); } return(result); }
public static DotNetProcess GetRunningProcess() { var result = DotNetProcess.GetCurrentProcess(); return(result); }