mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-08-15 14:22:57 -06:00
SysInfo_demo_console: Improved OS support
git-svn-id: svn://ultimatepp.org/upp/trunk@6449 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
c81543aec7
commit
88512cd8a6
1 changed files with 19 additions and 2 deletions
|
|
@ -18,7 +18,6 @@ void Puts(String s)
|
|||
SaveFile(file, LoadFile(file) + "\n" + s);
|
||||
}
|
||||
|
||||
|
||||
void Test()
|
||||
{
|
||||
Puts("SysInfo functions demo");
|
||||
|
|
@ -45,6 +44,13 @@ void Test()
|
|||
else
|
||||
Puts("Problem reading newtwork data");
|
||||
|
||||
Puts("\nNetwork adapter info");
|
||||
Array <NetAdapter> netAdapters = GetAdapterInfo();
|
||||
for (int i = 0; i < netAdapters.GetCount(); ++i)
|
||||
Puts(Format("- %s %s %s\n %s\n IP4: %s IP6: %s", netAdapters[i].type,
|
||||
netAdapters[i].mac, netAdapters[i].fullname,
|
||||
netAdapters[i].description, netAdapters[i].ip4, netAdapters[i].ip6));
|
||||
|
||||
Puts("\nSystem info:");
|
||||
String manufacturer, productName, version, mbSerial;
|
||||
Date releaseDate;
|
||||
|
|
@ -244,7 +250,18 @@ void Test()
|
|||
}
|
||||
|
||||
CONSOLE_APP_MAIN
|
||||
{
|
||||
{
|
||||
Puts("\nOs info:");
|
||||
String kernel, kerVersion, kerArchitecture, distro, distVersion, desktop, deskVersion;
|
||||
if (!GetOsInfo(kernel, kerVersion, kerArchitecture, distro, distVersion, desktop, deskVersion))
|
||||
Puts("Error getting Os info");
|
||||
else {
|
||||
Puts(Format("Kernel: %s, version: %s,\narchitecture: %s", kernel, kerVersion, kerArchitecture));
|
||||
Puts(Format("Distro: %s, version: %s", distro, distVersion, desktop, deskVersion));
|
||||
Puts(Format("Desktop: %s, version: %s", desktop, deskVersion));
|
||||
}
|
||||
getchar();
|
||||
|
||||
FileDelete(AppendFileName(GetDesktopFolder(), "log"));
|
||||
Puts("Introduce enter or (l) to log off, (r) to reboot or (s) to shutdown");
|
||||
char str[50];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue