3

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

friedkiwi
  • 2,158
  • 8
  • 29
  • 52
  • 1
    To be honest, after supplying my answer I am surprised you did not check it out for yourself! But anyway... – t0mm13b Jan 30 '10 at 15:12
  • Thanks, I thought there might be an unified class which contained all system access functions. – friedkiwi Jan 30 '10 at 15:56

1 Answers1

3

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.

t0mm13b
  • 34,087
  • 8
  • 78
  • 110