Solved

Visual C# advice needed, retreiving windows system information.

Posted on 2006-11-22
6
431 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
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
Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

 
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

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
powerN  challenge 3 49
C Programming - If Statement 8 51
recursion example 16 71
Java Loop 6 25
Introduction This question got me thinking... (http://www.experts-exchange.com/questions/28707487/GLOBALS.html) Why shouldn't we use Globals? This is a simple question without a simple answer.  How do you explain these concepts to a programmer w…
A short article about a problem I had getting the GPS LocationListener working.
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 seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

743 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now