This is an automated conversion of a C# routine I've used...
<DllImport("kernel32.dll")> _
Private Shared Function GetVolumeInformation(ByVal PathName As String, ByVal
VolumeNameBuffer As StringBuilder, ByVal VolumeNameSize As UInt32, ByRef
VolumeSerialNumber As UInt32, ByRef MaximumComponentLength As UInt32, ByRef
FileSystemFlags As UInt32, ByVal FileSystemNameBuffer As StringBuilder,
ByVal FileSystemNameSize As UInt32) As Long
End Function
Friend Function GetVolumeSerial(ByVal strDriveLetter As String) As String
Dim serNum As System.UInt32 = 0
Dim maxCompLen As System.UInt32 = 0
Dim VolLabel As StringBuilder = New StringBuilder(256)
Dim VolFlags As UInt32 = New UInt32
Dim FSName As StringBuilder = New StringBuilder(256)
strDriveLetter += ":\"
Dim Ret As Long = GetVolumeInformation(strDriveLetter, VolLabel,
CType(VolLabel.Capacity, UInt32), serNum, maxCompLen, VolFlags, FSName,
CType(FSName.Capacity, UInt32))
Return Convert.ToString(serNum)
End Function
--
Bob Powell [MVP]
Visual C#, System.Drawing
Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm
Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm
All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.
"abeer el ashker" <ab***********@discussions.microsoft.com> wrote in message
news:7A**********************************@microsof t.com...
how can i get serial numper of hard disk using api