Functions for system status C#

只谈情不闲聊 提交于 2019-12-01 23:02:28

问题


I'm looking for general system state functions for Mono. Things I need are:

  • Memory (available, total)
  • Free disk space
  • IP Number
  • External IP
  • Running processes / services / daemons

How do I get those?

Thanks in advance,

Yvan


回答1:


In the order of your list requirements, I have outlined the necessary namespaces for those functions. Since you did not supply the platform...

  • Memory (available/total) Perhaps, System.Environment class?
  • Free Disk Space (Mono.Unix.DriveInfo namespace) System.IO.DriveInfo?
  • IP number (Mono.Unix.UnixEndPoint) System.Net.EndPoint?
  • External IP address - not sure about this, this would be based on the output of ipconfig or ifconfig, or check the routing tables.
  • Running processes/services/daemons (Mono.Unix.UnixProcess) System.Diagnostics.Process class?

Hope this helps, Best regards, Tom.



来源:https://stackoverflow.com/questions/2168191/functions-for-system-status-c-sharp

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!