Horje
c# get process file location Code Example
c# get process file location
public static string GetProcessPath(int processId)
{
    string MethodResult = "";
    try
    {
        string Query = "SELECT ExecutablePath FROM Win32_Process WHERE ProcessId = " + processId;

        using (ManagementObjectSearcher mos = new ManagementObjectSearcher(Query))
        {
            using (ManagementObjectCollection moc = mos.Get())
            {
                string ExecutablePath = (from mo in moc.Cast<ManagementObject>() select mo["ExecutablePath"]).First().ToString();

                MethodResult = ExecutablePath;

            }

        }

    }
    catch //(Exception ex)
    {
        //ex.HandleException();
    }
    return MethodResult;
}




Csharp

Related
c# list audio devices Code Example c# list audio devices Code Example
check file lock c# Code Example check file lock c# Code Example
Metadata publishing for this service is currently disabled Code Example Metadata publishing for this service is currently disabled Code Example
wpf toolbar disable overflow Code Example wpf toolbar disable overflow Code Example
c# set cursor pos Code Example c# set cursor pos Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
12