[Gtk-sharp-list] System.Windows.Forms.SystemInformation equivalent

Natalia Portillo claunia at claunia.com
Tue Sep 7 12:23:19 EDT 2010


Hi,

The idea is to have a class toolkit independent.
Asking Gdk.* is like referencing System.Windows.Forms (it is always available in Mono even if you don't use it to draw the windows) and taking the SystemInformation class.

El 07/09/2010, a las 16:35, Christopher David Howie escribió:

> On 09/07/2010 09:54 AM, Natalia Portillo wrote:
>> BootMode could reflect runlevel.
> 
> Useless, since different distros use different runlevels to mean
> different things.
> 
>> ComputerName
> 
> Stored in /etc/hostname
zeus:~ claunia$ cat /etc/hostname
cat: /etc/hostname: No such file or directory

Not portable, file does not exist on all UNIXes.

>> DebugOS if kernel is compiled debug
> 
> I'm not sure why you would need to know this and I'm not honestly even
> aware if there is a userland flag to indicate this.  Maybe you could
> parse it from the "uname -a" output?
No you cannot use uname -a.
I don't know if all kernels have an option to guess it (Mac OS X does).

>> Network is just a bool, is there any network at all?
> 
> This depends on what you mean by "is there any network".  You will have
> to clarify this point.  Do you mean "user can reach the Internet," or
> "user has access to something except localhost," or "the kernel supports
> networking," or...
User has any enabled network interface different than localhost, wherever it returns to.
That's what the property shows in Windows.

>> PowerStatus on ACPI
> 
> You'll have to be more specific about what kind of information you want.
Check yourself. You can check if AC is connected, battery present, battery percentage, all in Microsoft documentation.

>> UserDomainName this should be more about Samba joined to a domain, or
>> OpenDirectory on OS X.
> 
> If you want to know the Samba domain, you will have to query Samba.  The
> *nix meaning of domain is very different from what Windows calls a
> "domain" (a term it has hijacked to mean something very different from
> what the rest of the world calls a domain).
Anyway it is bad implemented on current System.Windows.Forms.SystemInformation class, my Linux box returns hades (hostname) instead of claunia.com (domain name).

Regards,
Natalia Portillo
Claunia.com


More information about the Gtk-sharp-list mailing list