Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

多开时无法正确识别进程 #41

Open
Cnzw opened this issue Feb 6, 2024 · 0 comments
Open

多开时无法正确识别进程 #41

Cnzw opened this issue Feb 6, 2024 · 0 comments

Comments

@Cnzw
Copy link

Cnzw commented Feb 6, 2024

var processes = Process.GetProcessesByName(processName);
L421使用了进程名字来判断进程,导致多开的管理软件无法正确识别进程

因不会C#语言,GPT告诉我可以通过如下代码识别进程的目录

Process process = Process.GetProcessesByName("notepad")[0];
string filePath = process.MainModule.FileName;  
string directoryPath = Path.GetDirectoryName(filePath);

烦请作者修复

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant