how to Microsoft Windows NT 6.1.7601 Service Pack 1get basic system information? RRS feed

  • Question

  • User-271248197 posted

    well, long time I've been gone....but that basically means I haven't had any trouble.

    until now, I'm working on a testing server, this system will be available only in a LAN (or, VPN actually (PPTP)), and for the others that work with it I want to show some basic system information on one page.

    the information I want is the total physical processors, the total logical processors, total RAM (in MB), the logical Operating System name, and the machine name (NetBIOS).

    so far I can find the NetBIOS name (System.Environment.MachineName), the total logical processors (System.Environment.ProcessorCount) and the exact OS version (System.Environment.OSVersion.ToString).

    there are a few problems.

    1. I can't get the total amount of physical processors, just the logical processors (e.g. not the amount of processors, but only the amount of processor cores)
    2. the NetBIOS name is shown in all-caps, and I want it shown like "System Properties" in Windows 7 does (e.g. DesktopPC, not DESKTOPPC)
    3. I only get the OS's Kernel Version (Microsoft Windows NT 6.1.7601 Service Pack 1), and not the logical name (Microsoft Windows 7 SP1)
    4. I can't get any value for the amount of RAM.

    as far as code goes, I have this:

    Dim netbios As String
                Dim osver As String
                Dim x64os As Boolean
                Dim cpunum As String
                netbios = System.Environment.MachineName()
                osver = System.Environment.OSVersion.ToString()
                cpunum = System.Environment.ProcessorCount()
                x64os = System.Environment.Is64BitOperatingSystem()
                Response.Write("Server: " + netbios + "<br>")
                Response.Write("Operating System: " + osver)
                If x64os = True Then
                    Response.Write(" 64-Bit<br>")
                End If
                Response.Write("Processor Cores: " + cpunum + "<br>")

    which gives this on my desktop:

    Server: DESKTOPPC
    Operating System: Microsoft Windows NT 6.1.7601 Service Pack 1 64-Bit
    Processor Cores: 4

    which is as expected, but the number of actual processors and the memory are missing, and not all team members know which kernel version each windows release has.

    Ow, and before anyone give a warning in regards to security, if anyone who means harm gets to this page, there is a other more serious security issue.

    Friday, December 9, 2011 11:46 AM

All replies

  • User825046242 posted

    1. Have a look at this: http://www.codeproject.com/KB/cs/System_Meter.aspx maybe you can find some guidance on finding the # of processors in there.  However, I am curious, why do you want the number of processors rather than the number or cores?  Most users are happy to know the number of cores.

    2. For this on I think you you are going to have to parse the string your self and format as needed.

    3. Again, this will be a bit more work, but it would be a simple case statement keyed off of the version number. 

    4. Have a look at this sample : http://social.msdn.microsoft.com/Forums/en/netfxbcl/thread/27ed53ff-f88e-463d-a27d-5c55fb290be9

    Thursday, December 15, 2011 8:19 AM
  • User-1815173194 posted

    the .net library offers only limited resources when it comes to stuff like you mentioned, you will need to use a native/c++(win32 dll's) code to get what you are looking for

    Thursday, December 29, 2011 8:02 AM