We have a VB6 app which uses the computer's C: drive serial number for security. We have the App installed on computer B, and it runs fine on computer B. The app can read the serial number from computer B's C drive. When accessing the app from computer A on shared computer B over the LAN, the app reads the C: driver serial number from computer A, not computer B. I need to know how to read the C: driver serial number from computer B, the computer with the app installed.
Here's the code I use:
Public Function GetSerialNumber( _
ByVal sDrive As String) As Long
If Len(sDrive) Then
If InStr(sDrive, "\\") = 1 Then
' Make sure we end in backslash for UNC
If Right$(sDrive, 1) <> "\" Then
sDrive = sDrive & "\"
' If not UNC, take first letter as drive
sDrive = Left$(sDrive, 1) & ":\"
' Else just use current drive
sDrive = vbNullString
' Grab S/N -- Most params can be NULL
Call GetVolumeInformation( _
sDrive, vbNullString, 0, GetSerialNumber, _
ByVal 0&, ByVal 0&, vbNullString, 0)
Hello, I assume in this bit of your details - > ' Grab S/N -- Most params can be NULL Call GetVolumeInformation( _ sDrive, vbNullString, 0, GetSerialNumber, _ ByVal 0&, ByVal 0&, vbNullString, 0) End Function the Mai multe
6 freelanceri licitează în medie 175$ pentru acest proiect
Hi, There are somethings to do before running drive serial get function. some details required so, i can provide solution. If you need ex: 5 PCs to run with one serial number you must put in connection. I am happy to h Mai multe
Thanks for your sharing your issue. How can i help you? I have rich experiences in VB6 (over 7 years). Let's discuss further more. Thanks