How To Get Computer Serial Number In Vbnet

You want to set the Scope property on the ManagementObjectSearcher. In C# it looks something like this: System.Management.ConnectionOptions options = new System.Management.ConnectionOptions(); options.Username = 'username'; //could be in domain user format options.Password = 'Secret!!!'

What thatraja didn't mention, and probably doesn't know about, is that these methods don't work for all hard drives. Overall, there are I think 4 different methods for retrieving the hard drive serial number, so long as they are not in a RAID configuration. Which of the methods works depends on the drive.

How to Retrieve the REAL Hard Drive Serial Number[^]. Methods for retrieving the hard drive serial number, so long as they are not in a RAID configuration.

There is no way to tell ahead of time which will work and which don't. You'd have to write code to try all 4 methods, then evaluate the return data for your actual value.

No, I don't have example code. I prefer (and use) the following function: Public Function GetDriveSerialNumber() As String Dim DriveSerial As Integer ' Create a FileSystemObject object Dim fso As Object = CreateObject( ' Scripting.FileSystemObject') Dim Drv As Object = fso.GetDrive(fso.GetDriveName(Application.StartupPath)) With Drv If.IsReady Then DriveSerial =.SerialNumber Else ' 'Drive Not Ready!'

DriveSerial = -1 End If End With Return DriveSerial.ToString( ' X2') End Function Perhaps the Thread-Starter likes it too. When answering a question please: • Read the question carefully. • Understand that English isn't everyone's first language so be lenient of bad spelling and grammar. • If a question is poorly phrased then either ask for clarification, ignore it, or edit the question and fix the problem. Insults are not welcome.

This is now a Collectors Item. Ferrari edition traffic assist pro 7929 tmc update chrome. We would like to draw your attention to the fact that this model dates back to 2008 or earlier.

• Don't tell someone to read the manual. Chances are they have and don't get it.

Provide an answer or move on to the next question. Let's work to help developers, not make them feel stupid.