Search - Articles
DevASP.NET for ASP.NET, VB.NET, XML and C# (C-Sharp) Developers Tuesday, March 03, 2009
Dev Articles
Search Directory
ASP.NET
VB.Net
C-Sharp
SQL Server
 

How to get Windows' serial number using Visual Basic.Net.

Author: Shahzad

This code example will help you find out the serial number of your Windows operating system using VB.Net.

Import following namespace.

Imports System.Management

Declare following object variables.

Dim objMOS As ManagementObjectSearcher

Dim objMOC As Management.ManagementObjectCollection

Dim objMO As Management.ManagementObject

Execute query to get results.

objMOS = New ManagementObjectSearcher("Select * From Win32_OperatingSystem")

objMOC = objMOS.Get

Now get Windows' serial number from the query result.

For Each objMO In objMOC

MessageBox.Show(objMO("SerialNumber"))

Next

Dispose object variables.

objMOS.Dispose()

objMOS = Nothing

objMO.Dispose()

objMO = Nothing

 

 

Article Comments
I need guide for vb.net

Posted on 8/16/2006 12:16:59 AM by Mahendran

How can we get the Windows Serial Number on the Laptop ?

Posted on 8/16/2006 6:21:08 AM by cuong

I liked your site

Posted on 9/21/2006 4:36:54 AM by Jim Dobson

very good site for developers.........good work

Posted on 3/15/2007 5:46:18 AM by ashfaque shaikh

Hi...

I hve doubt pls hlp me..

How to get the client system serial number using vb.net

Posted on 4/11/2007 6:29:52 AM by Kalirajan

How do you do Shahzad from far. I like your site.
Please you tell me,source code how to someone can not copy file from a disc to in computer.

Posted on 2/2/2009 7:27:55 PM by vothsokha

Comments finally working:)

Posted on 11/21/2010 10:22:01 AM by acomplia receptors

   
Add Article Comment:
Name :
Email Address :
   
Comments :
 
   
<< How to get MAC address of your system.

Disclaimer - Privacy
© 2002-2017 DevASP.net