locked
Nmapi.cs (c# api for using Network Monitor), can't get processname by npl GetProcessName() RRS feed

  • Question

  • I use Nmapi.cs to devlop a proxy program like proxifier.

    and i add "Conversation.ProcessName = GetProcessName()," in npl,

    then  i use "NetmonAPI.NmGetPropertyById' function to get its values,

    but return "NmPropertyValueType.PropertyValueNone"

    so i try to add "Conversation.ProcessName = "abc"," in npl to check there is some problem i make

    but i can get value "abc"

    so wether  "GetProcessName()" can't be using in c#APi

    thanks for help


    Friday, June 5, 2020 11:14 AM

All replies

  • Hi,

    Thanks for posting here.

    Can you debug or print the string value returned by GetProcessName(), if you want to get the process name of the current process, you could try to use win32 api: GetModuleFileName + PathFindFileName.

    Or if you need to get the process name of the specified process id, you can use  Process.GetProcessById:

    Process.GetProcessById(id).ProcessName

    Best Regards,

    Drake


    MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Monday, June 8, 2020 6:32 AM