PDA

Click to See Complete Forum and Search --> : Displaying the health of the system.


JenniferBabe
Sep 27th, 2005, 09:15 AM
Hey. I need some major help. All these guys in here like they are scared of a girl who is a programmer, and i'm not getting help. I have to display the health of the system as in:

CPU usage (already working)
cpu temperature
hard drive space
memory space

I've been trying to find tutorials on the last three, if someone knows any pages, please post them for me. Thank you very much - Jennifer

grilkip
Sep 27th, 2005, 09:37 AM
I don't know about temperature but see what you can get with the PosPower (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/ccl/html/T_Microsoft_PointOfService_PosPower_Members.asp) class.

JenniferBabe
Sep 27th, 2005, 11:11 AM
Thanks. These methods seems like they could help me with what I have to do except I have a little problem. I hope this is not a stupid question but I will still ask. I was trying experimenting with some of the methods and it was not building since a namespace was missing. I tried using microsoft.PointOfService, but not sure how to create an assembly. But still not getting through. What am i doing wrong? I was experimenting with the StatusFanRunning.

grilkip
Sep 27th, 2005, 11:13 AM
To know if your question is stupid I would have to understand it, which I don't, fully. But you might have to add a reference to make it work :confused:

grilkip
Sep 27th, 2005, 11:27 AM
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/ccl/html/b27b3555-a40c-4726-9bd1-12f970c6414e.asp

This seems more complicated then I thought :(

Better keep looking for another way I think.

StrangerInBeijing
Sep 27th, 2005, 11:21 PM
All these guys in here like they are scared of a girl who is a programmer, and i'm not getting help.
What de heck is that suppose to mean?
This is not a man's world. I set in a office with nearly 500 developers/testers/etc, and half of them are female.

Am I male? Am I female? No one knows...I get help!
Maybe I should have made my name "DeafStranger", then use my *****ty hearing as an excuse to get help.

grilkip
Sep 28th, 2005, 08:20 AM
What de heck is that suppose to mean?

I took it as a joke :D

RobDog888 has a VB.NET codebank submission that displays various info about the system.

http://www.vbforums.com/showthread.php?t=347552





Removed unnecessary comment. Hack

Edit: For the record: I disagree with this.

JenniferBabe
Sep 28th, 2005, 08:45 AM
Thank you for your help Grilkip. I've been trying to figure out the information from the first class that u gave to me. There's an assembly there called microsoft.pointofservice.dll. I'm using .net2003 but I'm not seeing it in the AddReference section. I think I have to download this assembly? Am I right? Boy, this is turning out to be harder than I thought!



And, At the moment, i'm not wearing a top on, sorry. http://www.vbforums.com/newreply.php?do=newreply&noquote=1&p=2184748#
Smilie

grilkip
Sep 28th, 2005, 09:22 AM
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/ccl/html/N_Microsoft_PointOfService.asp

With a closer look I see that it's actually a part of the whole mobile development thing.


;)

JenniferBabe
Sep 29th, 2005, 08:28 AM
So the question still remains. How do I display the:

CPU Temperature
Ram space


I already got the hard drive space to display. I know this is low level stuff so its not popular. GrilKip, I am exhausted trying to get the microsoft.pointofservice namespace to work. I just do not know what else to do. Does anyone else know what I could do to get the above to display? Please help me somebody

Jennifer

penagate
Sep 30th, 2005, 12:03 AM
I'm not sure of a pure .NET way but you can use GlobalMemoryStatus() to find the RAM information.

using System.Runtime.InteropServices;

struct MEMORYSTATUS {
public int dwLength;
public int dwMemoryLoad;
public int dwTotalPhys;
public int dwAvailPhys;
public int dwTotalPageFile;
public int dwAvailPageFile;
public int dwTotalVirtual;
public int dwAvailVirtual;
}

// --------------

[DllImport("kernel32")]
private static extern void GlobalMemoryStatus (
ref MEMORYSTATUS lpBuffer
);

private void button1_Click (object sender, EventArgs e)
{
MEMORYSTATUS memstat = new MEMORYSTATUS();
memstat.dwLength = Marshal.SizeOf(memstat);
GlobalMemoryStatus(ref memstat);

MessageBox.Show("You have " +
(memstat.dwAvailPhys / 1048576) +
" MiB physical RAM free out of " +
(memstat.dwTotalPhys / 1048576) + ".");
}

JenniferBabe
Oct 4th, 2005, 07:41 AM
Thanks Guys, and hugs to you penegate. I got the ram to work. Ther is one more and that is the cpu temperature. Is there a way to find out this? Grilkip helped me a lot with this but up to now I am still lost. Does anyone know how to display the cpu temperature? If so, or you know of any articles, please tell me. Thanks to you all especially u penegate. You're really intelligent.

Jennifer

JenniferBabe
Oct 4th, 2005, 08:12 AM
Also. Does anyone know about the microsoft.PointofService namespace? Cause i'm not seeing that assembly on my system. How do I reference this?

jmcilhinney
Oct 4th, 2005, 09:47 AM
All that POS stuff is for Windows XP Embedded. If you go to one of the help topics and look up the TOC tree you'll see that it's rooted in the Mobile and Embedded Development section. That's for POS equipment that uses Windows XP Embedded as its OS.

JenniferBabe
Oct 4th, 2005, 09:58 AM
So the question still remains. how could I display the cpu temperature of my system?

penagate
Oct 6th, 2005, 03:21 AM
Well I did some reading and it seems it is not a standard operation. Temperature sensors differ between mainboards and are generally an option (although present on pretty much all modern mainboards). Specialised utilities such as SiSoft Sandra or Motherboard Monito would have code to get temperature readings from a variety of chips.

Is this for a particular system, or a generalised solution? If it is the latter then I think you will have to decide which sensor chips you want to support. If it is the former then you need to know what mainboard it is for and what the sensor chip on that board is.

deranged
Oct 6th, 2005, 03:07 PM
I often see lots of programs that will display computer information, including the Temp of various parts of the computer, However, all of these programs that I've seen do this rely fully on another program to run. The other program is Motherboard Monitor 5 (http://mbm.livewiredev.com/).

I've never worked with it for anything more than to display the temperature to me, so I don't know how to retrieve the values from the program, but I know it's gotta be pretty easy since a lot of other programs do it no problem.

JenniferBabe
Oct 7th, 2005, 07:39 AM
The thing is that I have to construct a program to read the cpu temperature and I cannot assume what type of motherboard is being read from. I saw some code on the internet the other day, I forgot the url so here's the copied code:

using System;

namespace test
{
using System.Runtime.InteropServices;
class Class1
{
[DllImport("asus.dll")]
public static extern Int32 GetCPUTemperature();
[DllImport("asus.dll")]
public static extern Int32 GetMBTemperature();

static void Main(string[] args)
{
Int32 cpuTemp = GetCPUTemperature();
Console.WriteLine("CPU Temperature: {0}C/{1:F0}F", cpuTemp, Fahrenheit(cpuTemp));
Int32 mbTemp = GetMBTemperature();
Console.WriteLine("Motherboard Temperature:{0}C/{1:F0}F", mbTemp, Fahrenheit(mbTemp));
Console.Read();
}

static double Fahrenheit(Int32 temperature)
{
double dblTemp = (Convert.ToDouble(temperature)* 1.8) + 32.0;
return dblTemp;
}
}
}




But the thing with this code and most of the other pseudocode that I found on the internet is that it is specific to one type of motherboard, the above is specific to Anthlon. I have to find a way to read cpu temperatures from a huge system of computers that may have many different types of motherboards.

Now here's what. You could read the cpu temperature in the bios. Is there a way that I can access the bios? Tutorials on this whole topic area is almost non existant as far as my searches shows.

If I cannot get this out in a few days, I guess i will have to go deranged way and have a program read it for me. But right now, I want to have my program read it.


Jennifer

penagate
Oct 7th, 2005, 09:58 AM
You could probably extract it from the BIOS, or failing that, individual sensor chips, but in any case it is a fairly low-level operation that C# is not capable of.

JenniferBabe
Oct 7th, 2005, 10:55 AM
I realize that it's a very low level operation. I am at the moment doing some searching to see if I could get a dll or com file or something out there to do it for me and just read it in. When I get it out, I will post what I did.

Jennifer

singhswat
Jul 7th, 2006, 02:10 AM
hi yar,
my system is not have thing "microsoft.point of service.dll" can u provide a solution to this issue.....

grilkip
Jul 7th, 2006, 02:12 AM
I am sorry I even mentioned it, look at wat jmcilhinney said:
All that POS stuff is for Windows XP Embedded. If you go to one of the help topics and look up the TOC tree you'll see that it's rooted in the Mobile and Embedded Development section. That's for POS equipment that uses Windows XP Embedded as its OS.