ParsX.com
پذیرش پروژه از دانشجویی ... تا سازمانی 09376225339
 
   ProfileProfile   Log in to check your private messagesLog in to check your private messages  |  FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups Log inLog in   RegisterRegister 

درخواست : پيدا كردن سريال هارد

 
Post new topic   Reply to topic    ParsX.com Forum Index -> ويژوال بيسيك .NET
View previous topic :: View next topic  
Author Message
[SaMaN]
مهمون يكي دو روزه


Joined: 06 Jun 2006
Posts: 18
Location: رامهرمز ( 90 كيلومتري اهواز ‌)

PostPosted: Fri Jun 16, 2006 2:22 pm    Post subject: درخواست : پيدا كردن سريال هارد Reply with quote

سلام دوستان

من يه OCX يا كدي مي‌خوام كه بتونه سريال هارد رو پيدا كنه كه بتونم تو برنامه ازش استفاده كنم.

دستتون واقعا درد نكنه .

تا بعد...!
Back to top
vahid
بي تو هرگز


Joined: 26 Nov 2004
Posts: 3067
Location: Tehran

PostPosted: Sat Jun 17, 2006 3:18 pm    Post subject: Reply with quote


 'Note: This code requires a referecne to the Microsoft Scripting Runtime library (SCRRUN.DLL)
      Private Sub Form_Load()
     
          'Show drive serial number for the current drive
          MsgBox " Drive serial number for " & Left(App.Path, 1) & ": " & GetDriveSerialNumber
          End
     
      End Sub
     
      Public Function GetDriveSerialNumber(Optional ByVal DriveLetter As String) As Long
     
          Dim fso As Object, Drv As Object
         
          'Create a FileSystemObject object
          Set fso = CreateObject("Scripting.FileSystemObject")
         
          'Assign the current drive letter if not specified
          If DriveLetter <> "" Then
              Set Drv = fso.GetDrive(DriveLetter)
          Else
              Set Drv = fso.GetDrive(fso.GetDriveName(App.Path))
          End If
     
          With Drv
              If .IsReady Then
                  DriveSerial = Abs(.SerialNumber)
              Else    '"Drive Not Ready!"
                  DriveSerial = -1
              End If
          End With
         
          'Clean up
          Set Drv = Nothing
          Set fso = Nothing
         
          GetDriveSerialNumber = DriveSerial
         
      End Function

منبع :
http://www.vbgold.com/vb-projects/disk-serial-number.shtml
Back to top
Display posts from previous:   
Post new topic   Reply to topic    ParsX.com Forum Index -> ويژوال بيسيك .NET All times are GMT + 3.5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum