This is the C# version of the Python process management tool, with a corresponding Python version available (focused on rapid development, flexible modification, and direct invocation in development environments). The C# version prioritizes long-term maintenance and high-speed operation, making it suitable for scenarios requiring stable performance. Note: The UI aesthetics are slightly simpler than the Python version, and due to technical limitations, automatic refresh is not implemented—manual refresh via the button is required.
- Manual Refresh: Click the "Refresh List" button to manually update the list of running Python processes (
python.exe
/pythonw.exe
), displaying PID, process name, memory usage, and executable path. - Multi-Language Support: Switch between Simplified Chinese/English with one click (via the "Switch Language" button), no additional language packs required.
- Safe Termination: Select a process and click "Terminate Process" to stop it. Handles exceptions like permission issues or already exited processes with clear prompts.
- Visualized Information: Custom-rendered process list with color-coded details (PID in accent color, path in subtle text) for better readability.
No .NET SDK required (but needs .NET Framework 4.8+):
- Go to the Releases page.
- Download
PythonProcessKiller-C#-EXE.zip
and extract it. - Run
PythonProcessKiller-C#.exe
directly.
Requires .NET Framework 4.8 SDK :
- .NET Framework 4.8 SDK (download here)
- Command Prompt (Windows)
-
Download source code:
- Go to the Releases page, click "Source code (ZIP)" to download.
- Extract the ZIP to your preferred location.
-
Compile via command line:
# Navigate to the extracted folder (where *.cs files are located) cd PythonProcessKiller-Csharp # Compile using csc (C# compiler) csc /target:winexe /out:bin/ProcessKillerApp.exe *.cs /r:System.dll /r:System.Windows.Forms.dll /r:System.Drawing.dll
- After successful compilation, run
bin/ProcessKillerApp.exe
.
- After successful compilation, run
Switch languages via the "Switch Language" button. Core functions are identical across languages.
Objective: Terminate a process with the path D:\test\pyt.py
that has high memory usage.
Steps:
- Launch the app. The initial list shows no data (manual refresh required).
- Click "Refresh List" to load current Python processes.
- Select the target process in the list (highlighted on click).
- Click "Terminate Process" and confirm in the pop-up.
- On success, the status bar shows "Successfully killed process PID: XXXX", and the list refreshes automatically.
Goal: Change the interface to English.
Steps:
- Click the "Switch Language" button (top-right, labeled "切换语言" in Chinese).
- The interface updates to English, including buttons, labels, and status messages.
- Click "Refresh List" to reload process data in the new language.
Goal: Terminate a protected Python process.
Steps:
- Attempt to terminate the process. If a "permission denied" error occurs, close the app.
- Right-click the EXE/Compiled program and select "Run as Administrator".
- Retry termination—the elevated permissions should resolve the issue.
This project is licensed under the Apache License 2.0.
- Bug Reports/Feature Requests: Submit an Issue.
- Code Contributions: Fork the repo, make changes, and submit a PR (welcome to optimize UI rendering or add auto-refresh functionality).
- Localization: To add new languages, update the
_langResources
dictionary inForm1.cs
(referencezh-CN
anden-US
configurations).
本项目为 Python 进程管理工具 的 C# 版本实现,配套存在 Python 版本(侧重快速开发与灵活修改,支持直接在开发环境中调用运行)。C# 版聚焦 长期维护与高速运行,适合对性能稳定性要求较高的场景。注:界面美观度略逊于 Python 版,且因技术限制未实现自动刷新功能,需通过按钮手动刷新。
- 手动刷新:点击「刷新列表」按钮手动获取当前运行的 Python 进程(含
python.exe
/pythonw.exe
),显示 PID、进程名称、内存占用及可执行路径。 - 多语言支持:通过「切换语言」按钮一键切换 简体中文/英文 界面,无额外语言包依赖。
- 安全终止:选中目标进程后点击「终止进程」按钮尝试终止,自动处理无权限、进程已退出等异常场景(含明确提示)。
- 信息可视化:自定义绘制进程列表(PID 高亮显示、路径文本淡化处理),提升信息可读性。
无需安装 .NET SDK(需 .NET Framework 4.8+ 运行时):
- 前往 Releases 页面。
- 下载
PythonProcessKiller-C#-EXE.zip
并解压。 - 直接运行
PythonProcessKiller-C#.exe
。
需 .NET Framework 4.8 SDK:
- .NET Framework 4.8 SDK(下载地址:点此获取)
- Windows 命令提示符
-
下载源代码:
- 前往 Releases 页面,点击 "Source code (ZIP)" 下载压缩包。
- 解压至目标位置。
-
通过命令行编译:
# 进入解压后的文件夹(包含 *.cs 文件的目录) cd PythonProcessKiller-Csharp # 使用 csc 编译器编译(Windows 命令提示符) csc /target:winexe /out:bin/ProcessKillerApp.exe *.cs /r:System.dll /r:System.Windows.Forms.dll /r:System.Drawing.dll
- 编译成功后,运行
bin/ProcessKillerApp.exe
。
- 编译成功后,运行
目标:终止一个路径为 D:\test\pyt.py
且内存占用较高的进程。
步骤:
- 启动程序,初始列表无数据(需手动刷新)。
- 点击「刷新列表」加载当前 Python 进程。
- 在列表中选中目标进程(点击高亮)。
- 点击「终止进程」并在弹出框中确认。
- 成功后状态栏显示「已成功终止进程 PID: XXXX」,列表自动刷新。
目标:将界面切换为英文。
步骤:
- 点击右上角「切换语言」按钮(中文界面显示为「切换语言」)。
- 界面自动切换为英文,按钮、标签及状态信息同步更新。
- 点击「Refresh List」重新加载进程数据(英文界面按钮)。
目标:终止受保护的 Python 进程。
步骤:
- 尝试终止进程,若提示「无权限」错误,关闭程序。
- 右键点击 EXE 文件或编译后的程序,选择「以管理员身份运行」。
- 重新尝试终止,提升后的权限可解决此问题。
本项目采用 Apache 2.0 许可证。
- 问题反馈/功能建议:提交 Issue。
- 代码贡献:Fork 仓库,修改后提交 PR(欢迎优化界面渲染或添加自动刷新功能)。
- 多语言支持:如需添加其他语言,可在
Form1.cs
的_langResources
字典中补充翻译(参考zh-CN
和en-US
配置)。