如何从 C#.net 客户端列出 linux 运行进程? [英] How to list linux running process from C#.net client?

查看:40
本文介绍了如何从 C#.net 客户端列出 linux 运行进程?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想从我的 C#.net 客户端读取 linux 服务器中所有正在运行的进程?你能告诉我实现这一目标的方式或可能性吗?

I want to read all the running process in linux server from my C#.net client ? Can you please show me the way or possibility for achieving this ?

我们在同一个域中..我想没有防火墙问题,但我无法在服务器上编写或安装任何东西.

We are in same domain.. I guess no firewall issue and but I cannot write or install anything on server.

(我正在尝试获取在 linux box 上运行的进程 ID,当该进程更改进程 ID 时......我必须在我的客户端应用程序中运行一些逻辑)

(I am trying this to get hold of the process id running on linux box and when that process changes the process id .. i have to run some logic in my client app)

推荐答案

您需要通过 SSH 执行此操作.对于 C#,我会看看 SharpSSH.运行 ps -e |grep,您应该能够很容易地解析 ID 号.

You will need to do this via SSH. For C#, I'd take a look at SharpSSH. Run ps -e | grep and you should be able to parse the ID number quite easily.

据我所知,进程 ID 只会在进程重新启动时发生变化,但我对此没有权限.

As far as I know, process IDs only change when the process is restarted, but I am no authority on the matter.

这篇关于如何从 C#.net 客户端列出 linux 运行进程?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆