A step by step tutorial teaching you how to create your own chat client and chat server easily in C#, for local networks or the Internet.
A C# tutorial showing you how to make use of WMI to extract information on disk drives, such as model, capacity, sectors and serial number.
This tutorial will teach you how to calculate the shipping cost based on the weight, height, length and depth of the box, the distance and the UPS service type.
Creating a Rich Text Editor using JavaScript is easier to do than you might think, thanks to the support of modern browsers; this tutorial will walk you through it.
An introduction in retrieving WMI in C#This is a short introduction into retrieving WMI information using hard drive serial and model numbers as an example. |
On Thursday, July 8th 2004 at 04:39 AM By Andy Jump (View Profile) ![]() ![]() ![]() ![]() (Rated 4.4 with 25 votes) |
||
|
An introduction in retrieving WMI in C#.
Finally we want to display the information about the hard drives and wait for the user to hit enter before closing. Don’t forget to put these two classes into a namespace as well. So there you are, your very own little program to get hold of the information about a hard drive and the basis for getting any information from the WMI. Practical Applications The hard drive serial number is very useful for tying applications to a specific pc within licensing and activation code. The WMI has so much information in it that the uses for it are almost limitless from performance monitors to hardware detection and registry editors. The major source for WMI information can be found at: MSDN WMI |
|||
Digg It!
Del.icio.us
Reddit
StumbleIt
Newsvine
Furl
BlinkList
|
|||
|
|||
Current CommentsI want to retrieve the serial no, model no, and type of a processor using c#
Here's how:
http://www.eggheadcafe.com/articles/20030511.asp
hmmm the link to the msn seems duff ... here it is in plain text:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wmisdk/wmi/wmi_start_page.asp
Here is the page with all the info about the processor:
http://msdn.microsoft.com/library/en-us/wmisdk/wmi/win32_processor.asp?frame=true
just swap that out for the hdd info in the above code and you'll be sorted :)
and how about the motherboard id ? because i didn't find it on the net for c++/c# but only for delphi.
help me please, because i don't figure out how the classes work ...
If you look under the msdn link i gave in the post above there a section called WMI Reference on the left side bar, then click
WMI Classes
WIN32 Classes
Computer System Hardware Classes
WIN32_MotherboardDevice
that will display all the reference material for retiving the motherboard info. All you need to do is create the appropriate struct, change the info retival strings and loops and out will pop the info you need :)
At some point I will sit down and write down all that is needed to access all the WMI info easily but that will be a full componant for sale on our site.
i want to read registry of client from server machine
I want to get the web request made to my IIS server. I need the URL requested and the time of request.
I think there are some registary classes in the .net framework so You'll want to look at those swapnil.
Ramki have a look through the wmi reference ... if its there then cool but i have a feeling you may have to do some work with asp.net
hi ı wnat to system informatiın get c# workgrup and servis pack can u help me
how to find hard disk information including capacity
I am having an application where in, One thread will be tyring to read an Excel file using oledb.Second thread will be running simultaneouly, that will be creating an object of ManagementObjectSearcher and trying to get the Physical Memory Size.In this instance, once after reading the Excel file , the ManagementObjectSearcher is not able to create the instance.why??Pls if anyone know the answer , reply me.
Thanks!
I want to read database information of a remote machine using WMI. Which class will do this?
Any body help me how to disable hard disk of a remote computer using wmi in vb/c#
this one is c#, but anyone know how to do it in c++?
You example is good but not enought reliable, I use Ionworx MachineID SDK v3.0 for .NET and Win32, it's very nice!
More details : http://www.ionworx.com/machineid.html
Regards,
Dorian
Can some1 help me?
I'm trying to get partition information, and for every retreived partition I need to make another pictureBox control in my Form.
Thanks...
The above code is working fine in XP and 2k but not in 98 OS..
and also it is not retrieving some Harddisk serial number.
Can anyone give a better source or Win32 class that can be used to retrieve Harddisk serial number
Indeed, it doesn't work on Windows 98 because the application requires .NET Framework. What you can reuse from this tutorial in an application created in C++ are the WMI queries.
Hey andrei Pociu,
Even with .Net FW also it will not work in Win98 OS.
Can u give some Win32 API or class that can be used to get HDD serial number.
I got a code that can able to get Harddisk serial number in Winxp and Win 2k. But there is a probelm with this code too. This code is getting only the serial number of IDE HDD's.
Can someone help me in finding the serial number of All type of HDD's
Your code to find Hard disk serial number is interesting, but when I tried the program, Serial number is showing different in Master and Slave mode.
In Master Mode
IDESAMSUNG SP0411N
S01JJ30Y275145
And in Slave mode
IDESAMSUNG SP0411N
30534a31334a5930373231353534202020202020
Any idea why this is happening? My computer is having only one HDD. The serial number in slave mode looks like the value returned by \"PNPDeviceID\" for \"SELECT * FROM Win32_DiskDrive\" query.
Thank you for spending the time to write this and make the tutorial public. From your example I\'m now able to reference any WMI class through C#. Kudos for the KISS guide! :-)
hi, i have one doubt. how can trim the text to 5 char..in C#.net
pls tell me..
by prabha
hi, I have used this code.
But when I tried to retrieve the hard drive serial number, I am getting exception of \'Invalid class\' after
ManagementObjectSearcher MOS_HDSearcher = new ManagementObjectSearcher(\"SELECT * FROM Win32_PhysicalMedia\");
int i = 0;
foreach (ManagementObject MO_HD in MOS_HDSearcher.Get())
Please tell me how to get it working.
Thanks
-Ashwini
Very simple. Just write this:
string serno = \"\";
ManagementObject o =
new ManagementObject(\"Win32_LogicalDisk.DeviceID=\\\"C:\\\"\");
serno = o.Properies[\"VolumeSerialNumber\"].Value.ToString();
...
and etc.
Sir,
I have tried above code using System.Management Class. But when i debug my code then my application hangs in between. when I was retrieving the hard disk information with thi line of code
foreach (ManagementObject MO_HD in MOS_HDSearcher.Get())
Hi
I am trying to get my system hard disk serial No... If any one knows pls help me...
Hi
I am trying to get my system hard disk serial No... If any one knows pls help me... in C#.net windows application
hi,
i am doing my project in p2p file sharing.In that i have to list the logical drives of a remote computer from my system using C#.Is this possible..or else is it possible with WMI scripting..Please help me..reply me as soon as possible..am in critical situation please..
Following my analysis, thousands of people all over the world receive the loan from different banks. Thence, there's great possibilities to find a financial loan in any country.
I got he thing for getting the The height of the content area of a browser(ie viewport), but how do i get the height of the entire browser in ie8 including menubar,toolbar etc.For browser's other than ie8 this one works but for ie8 this one do not works. and I introduce your website perfect for my needs. It contains wonderful and helpful posts. I mortal listing most of them and got a lot from them. To me, you are doing the eager set. Fuddle on this. ingest at locating In the end, I would same to give you for making given a very website. Or where I could also gain several of my ranches for marketing substance for you all budy who come up here
Once you have recreated the problem and captured these steps, you can save them to a file and send it to your support person, who can then open it up and view
I just stumbled upon your blog and wanted to say that I have really enjoyed reading your blog posts.
I need to say that you are doing a fantastic job. Please keep up the great work.
Informative and interesting which we share with you so i think so it is very useful and knowledgeable. I would like to thank you for the efforts. Grant Applications
hese steps, you can save them to a file and send it to your support person, who can then open it up and view
You really make it seem so easy with your presentation but I find this topic to be really something which I think I would never understand.
I just stumbled upon your blog and wanted to say that I have really enjoyed reading your blog posts.
Nuestro software de fidelización de clientes gestiona cualquier programa de fidelización de clientes. Economico.Consúltanos
Please note this because we can catch early tickets if we have known the dates.
hello ı need to know computer features as harddisc, ram, screan etc. in c#
hello ı need to know computer features as harddisc, ram, screan etc. in c#
hello ı need to know computer features as harddisc, ram, screan etc. in c#
hello ı need to know computer features as harddisc, ram, screan etc. in c#
hello ı need to know computer features as harddisc, ram, screan etc. in c#
hello ı need to know computer features as harddisc, ram, screan etc. in c#
If you wanna retrieve information about the CDROM drive on a machine, you can write some simple queries in c# and get that job done...thanks
Thanks for this introduction.I'm very happy that there is someone out there who shares this information with us, the ones that are not that advanced in Java or C or #.
Thanks so much for your comment. I am waiting for this information. Join now to share.
Thanks so much for your comment. I am waiting for this information. Join now to share.
Getting Serial No as null . Why???
Windows Management Instrumentation (WMI) is Microsoft’s implementation of Web-Based Enterprise Management (WBEM), an industry initiative to provide a Common Information Model (CIM) for pretty much any information about a computer system. The Python WMI module is a lightweight wrapper on top of the pywin32 extensions, and hides some of the messy plumbing needed to get Python to talk to the WMI API. Check http://www.activextest.com/run-activex.html for more info.
Windows Management Instrumentation (WMI) is Microsoft's implementation of Web-Based Enterprise Management (WBEM), an industry initiative to provide a Common Information Model (CIM) for pretty much any information about a computer system. The Python WMI module is a lightweight wrapper on top of the pywin32 extensions, and hides some of the messy plumbing needed to get Python to talk to the WMI API.
you can create a management application that monitors an enterprise, provides event-based alerts, and allows a user to control different aspects of an enterprise.
If you wanna retrieve information about the CDROM drive on a machine, you can write some simple queries in c# and get that job done...thanks
An act of goodness is a smart financial commitment.
I appreciate the valuable details you provide in your material very awesome.
This post contains excellent original thinking. The informational content material here proves that points arent so black and white. I feel smarter from just reading this.
The informational content material here proves that points arent so black and white
It's an excellent demonstration of this problem. I am going to present your point of view to my students and I will ask them to think about other examples for this application, because there are many aspects that you didn't cover here.
Hi Buddy, Your blog website website is really style as fresh and fantastic and the details of your web page is very exciting, I really experienced it and I also want more details about this, thanks for discussing.
http://www.classicbikes.es/bicicletas/tienda-bicicletas-holandesas-de-segunda-mano
Related Tutorials
Related Source Code
C# Job SearchFrom the creators of Geekpedia, a revolutionary new coupon website!
BargainEZ has coupons codes, printable coupons, bargains and it is the leading source of Passbook coupons for iPhone and iPod touch devices.