Click here to Skip to main content
16,015,697 members
Home / Discussions / C#
   

C#

 
QuestionCan any one tell me how to extract Excel worksheet images and store them in database? Pin
Ali00099927-Apr-08 1:34
Ali00099927-Apr-08 1:34 
AnswerRe: Can any one tell me how to extract Excel worksheet images and store them in database? Pin
#realJSOP27-Apr-08 3:01
professional#realJSOP27-Apr-08 3:01 
GeneralRe: Can any one tell me how to extract Excel worksheet images and store them in database? Pin
Ali00099928-Apr-08 19:18
Ali00099928-Apr-08 19:18 
QuestionHow to get cpu temp c# .NET [modified] Pin
kennet197427-Apr-08 1:32
kennet197427-Apr-08 1:32 
AnswerRe: How to get cpu temp c# .NET Pin
Anthony Mushrow27-Apr-08 1:56
professionalAnthony Mushrow27-Apr-08 1:56 
GeneralRe: How to get cpu temp c# .NET Pin
Thomas Stockwell27-Apr-08 3:07
professionalThomas Stockwell27-Apr-08 3:07 
GeneralRe: How to get cpu temp c# .NET Pin
Anthony Mushrow27-Apr-08 3:15
professionalAnthony Mushrow27-Apr-08 3:15 
QuestionRe: How to get cpu temp c# .NET Pin
kennet197427-Apr-08 4:15
kennet197427-Apr-08 4:15 
Hi Thomas,

Thanks for your help,but I dont really understand it. I am just a beginner.


This code works properbly

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Management;

namespace GetCpuTemp
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}




private void button1_Click(object sender, EventArgs e)
{


ManagementClass processClass = new ManagementClass(@"root\WMI:MSAcpi_ThermalZoneTemperature");

foreach (ManagementObject service in processClass.GetInstances())
{



MessageBox.Show("CPU Temperature: " + service.GetPropertyValue("CurrentTemperature"));


}
}


The messagebox show me a temp. of 3012 kelvin and my problem now is, that I like to convert it to celcius and read it out on a messagebox. Can you please help me, because I dont know how to do it. I tryed this code, but I dont know how to get it out in a massegebox.


static decimal ConvertToCelsius(string reading)
{

return (decimal.Parse(reading) / 10 - 273.15m);

}







Regards Kennet
GeneralRe: How to get cpu temp c# .NET Pin
Christian Graus27-Apr-08 11:43
protectorChristian Graus27-Apr-08 11:43 
QuestionProcess information in C# Pin
I'm a member...27-Apr-08 0:48
I'm a member...27-Apr-08 0:48 
GeneralRe: Process information in C# Pin
Anthony Mushrow27-Apr-08 1:48
professionalAnthony Mushrow27-Apr-08 1:48 
GeneralRe: Process information in C# Pin
I'm a member...27-Apr-08 20:43
I'm a member...27-Apr-08 20:43 
GeneralApplication.Exit Pin
George_George26-Apr-08 22:18
George_George26-Apr-08 22:18 
GeneralRe: Application.Exit Pin
Urs Enzler26-Apr-08 22:38
Urs Enzler26-Apr-08 22:38 
GeneralRe: Application.Exit Pin
George_George26-Apr-08 22:47
George_George26-Apr-08 22:47 
GeneralRe: Application.Exit Pin
Urs Enzler26-Apr-08 22:55
Urs Enzler26-Apr-08 22:55 
GeneralRe: Application.Exit Pin
George_George26-Apr-08 22:58
George_George26-Apr-08 22:58 
GeneralRe: Application.Exit Pin
MarkB77726-Apr-08 23:41
MarkB77726-Apr-08 23:41 
GeneralRe: Application.Exit Pin
George_George26-Apr-08 23:45
George_George26-Apr-08 23:45 
GeneralRe: Application.Exit Pin
Luc Pattyn27-Apr-08 0:35
sitebuilderLuc Pattyn27-Apr-08 0:35 
GeneralRe: Application.Exit Pin
George_George27-Apr-08 1:44
George_George27-Apr-08 1:44 
GeneralRe: Application.Exit Pin
Luc Pattyn27-Apr-08 4:45
sitebuilderLuc Pattyn27-Apr-08 4:45 
GeneralRe: Application.Exit Pin
George_George27-Apr-08 17:17
George_George27-Apr-08 17:17 
GeneralRe: Application.Exit Pin
Luc Pattyn27-Apr-08 20:22
sitebuilderLuc Pattyn27-Apr-08 20:22 
GeneralRe: Application.Exit Pin
George_George27-Apr-08 20:38
George_George27-Apr-08 20:38 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.