Solved

Visual C# advice needed, retreiving windows system information.

Posted on 2006-11-22
6
446 Views
Last Modified: 2013-11-13
Hello all,
I'm a network admin trying to dabble in C# to automate some of my maintenance duties.

I need some pointers on writing a windows application in visual studio 2005 C# that can retreive system statistics (like diskspace, cpu utilisation, memory free) and write the results to an excel spreadsheet or better a sql database.

I am more concerned about the retreval of system info at this stage.

I am reading the Visual studio step by step book at the moment, but need a kick in the right direction.

I look forward to everyones suggestions.
0
Comment
Question by:andrewglendean
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 8

Expert Comment

by:YoungBonzi
ID: 18000453
I don't know if this is more than what you want, but take a look at the System.Diagnostics namespace: http://msdn2.microsoft.com/en-us/library/system.diagnostics.aspx
0
 
LVL 2

Expert Comment

by:amiableansari
ID: 18000854

the article shows this with vs 2003. and it displays all the information you get in system information console

http://www.codeproject.com/csharp/NitinSystemInfo.asp
0
 
LVL 5

Expert Comment

by:pdotnet
ID: 18001020
Since you're new to C# and showed interest in storing your data in SQL server, here's a great helper class from Microsoft that fully automates saving and loading data to SQL server.  

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnpag2/html/daab.asp

Data can be read and written in 1 line of code (with the right parameters) using the methods in this class.
0
What Is Transaction Monitoring and who needs it?

Synthetic Transaction Monitoring that you need for the day to day, which ensures your business website keeps running optimally, and that there is no downtime to impact your customer experience.

 
LVL 5

Accepted Solution

by:
sivachirravuri earned 75 total points
ID: 18001868
Hi,
Please check the following link for sample code & EXE.

http://www.codeproject.com/csharp/nitinsysteminfo.asp

Sample code:

using System;
using System.Management;

...

ManagementObject disk = new
ManagementObject("win32_logicaldisk.deviceid="c:"");
disk.Get();
Console.WriteLine("Logical Disk Size = " + disk["Size"] + " bytes");
Console.WriteLine("Logical Disk FreeSpace = " + disk["FreeSpace"] + " 
bytes");


0
 
LVL 5

Expert Comment

by:sivachirravuri
ID: 18178883
? ? No comment from Author
0
 
LVL 4

Author Comment

by:andrewglendean
ID: 18197602
Sorry guys, I've been busy with other matters. Thanks to all. I shared my results when ready.
0

Featured Post

Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this post we will learn different types of Android Layout and some basics of an Android App.
In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

695 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question