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.
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)
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)
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)
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>")
Else
Response.Write("<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.
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.
Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.
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
kitsuneofinf...
Member
3 Points
5 Posts
how to Microsoft Windows NT 6.1.7601 Service Pack 1get basic system information?
Dec 09, 2011 03:46 PM|LINK
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.
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>") Else Response.Write("<br>") End If Response.Write("Processor Cores: " + cpunum + "<br>")which gives this on my desktop:
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.
lprete
Member
385 Points
57 Posts
Microsoft
Re: how to Microsoft Windows NT 6.1.7601 Service Pack 1get basic system information?
Dec 15, 2011 12:19 PM|LINK
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
Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.
lamado
Member
220 Points
76 Posts
Re: how to Microsoft Windows NT 6.1.7601 Service Pack 1get basic system information?
Dec 29, 2011 12:02 PM|LINK
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
eclipse