Find Jobs
Hire Freelancers

Need hard driver serial number on shared computer with VB6

$30-250 USD

Completed
Posted almost 3 years ago

$30-250 USD

Paid on delivery
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 & "\" End If Else ' If not UNC, take first letter as drive sDrive = Left$(sDrive, 1) & ":\" End If Else ' Else just use current drive sDrive = vbNullString End If ' Grab S/N -- Most params can be NULL Call GetVolumeInformation( _ sDrive, vbNullString, 0, GetSerialNumber, _ ByVal 0&, ByVal 0&, vbNullString, 0) End Function
Project ID: 29964538

About the project

6 proposals
Remote project
Active 3 yrs ago

Looking to make some money?

Benefits of bidding on Freelancer

Set your budget and timeframe
Get paid for your work
Outline your proposal
It's free to sign up and bid on jobs
Awarded to:
User Avatar
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 code is actually calling the windows API GetVolumeInformation function in kernel32. If you're not familiar with this, you'll probably see something like the following, in the middle of a line very near the top of the page - GetVolumeInformation Lib "kernel32" If so, you are not actually getting the hard drive serial number but the volume serial number. I.e. it changes if the drive is formatted. Anyhow, I guess this isn't causing you any problems so the distinction doesn't really matter. The (volume) serial number is available from a network drive (a path like \\machineB\share, hence why looking for \\ in sDrive), which is how I assume Machine A is connecting to Machine B. I just gave this a try over here and I found for unc paths, GetVolumeInformation doesn't return anything. It does work fine if I map that same unc path to a drive letter. I guess this is what you are seeing. This shouldn't be that difficult to fix.
$150 USD in 7 days
5.0 (2 reviews)
2.8
2.8
6 freelancers are bidding on average $175 USD for this job
User Avatar
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 help. Thanks
$200 USD in 1 day
5.0 (22 reviews)
4.2
4.2
User Avatar
Hi there, I am a Professional Software Developer with 5+ years experience. I've worked with C/C++, VB, Python, PHP, JavaScript etc. Let's meet in chat so that we can discuss all the details of the project. I'm ready to start immediately. Thanks.
$140 USD in 2 days
5.0 (13 reviews)
3.7
3.7
User Avatar
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
$140 USD in 7 days
0.0 (0 reviews)
0.0
0.0

About the client

Flag of UNITED STATES
Livonia, United States
5.0
116
Payment method verified
Member since Jan 3, 2004

Client Verification

Thanks! We’ve emailed you a link to claim your free credit.
Something went wrong while sending your email. Please try again.
Registered Users Total Jobs Posted
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Loading preview
Permission granted for Geolocation.
Your login session has expired and you have been logged out. Please log in again.