473,379 Members | 1,337 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,379 software developers and data experts.

Using API calls

Hi,

I have developed dictionary (Eng, Ger, Fra, Ita) in Access. The word list
for each is in separate table (Eng_Ger), (Eng_Fra), (Eng_Ita).

I want to protect my dict from unlegal copying with next procedure:

examine and save the serial number of the hard drive using API calls.

Q: Does anybody know this procedure to help me finish this project.

Thanks
Jul 17 '05 #1
4 3491
On Fri, 14 May 2004 10:19:02 +0200, "ANSWER" <AN****@ANSWER.com>
wrote:
Hi,

I have developed dictionary (Eng, Ger, Fra, Ita) in Access. The word list
for each is in separate table (Eng_Ger), (Eng_Fra), (Eng_Ita).

I want to protect my dict from unlegal copying with next procedure:

examine and save the serial number of the hard drive using API calls.

Q: Does anybody know this procedure to help me finish this project.


Get the Downloadable API Guide from www.AllAPI.net

Look at the example for: GetVolumeInformation

(The serial number is returned as Decimal, you'll need to look at it
as Hex to prove that it is correct)
Jul 17 '05 #2
> >I have developed dictionary (Eng, Ger, Fra, Ita) in Access. The word
list
for each is in separate table (Eng_Ger), (Eng_Fra), (Eng_Ita).

I want to protect my dict from unlegal copying with next procedure:

examine and save the serial number of the hard drive using API calls.

Q: Does anybody know this procedure to help me finish this project.


Get the Downloadable API Guide from www.AllAPI.net

Look at the example for: GetVolumeInformation

(The serial number is returned as Decimal, you'll need to look at it
as Hex to prove that it is correct)


Although I wouldn't recommend using the hard drive serial number for
copy protection purposes (what happens when the user decides to upgrade
his hard drive to a larger size), perhaps this old post of mine will
help the OP out in getting the Hex value of the hard drive's serial
number.

Rick - MVP

Try using this declaration and function (you can pass the drive letter
in as a letter by itself, a letter followed by a colon or a letter
followed by a colon followed by a backslash). The serial number is
returned in Hex format. If the drive letter doesn't exist, the function
returns the string 00000000.

Private Declare Function GetVolumeInformation _
Lib "kernel32.dll" _
Alias "GetVolumeInformationA" _
(ByVal lpRootPathName As String, _
ByVal lpVolumeNameBuffer As String, _
ByVal nVolumeNameSize As Integer, _
lpVolumeSerialNumber As Long, _
lpMaximumComponentLength As Long, _
lpFileSystemFlags As Long, _
ByVal lpFileSystemNameBuffer As String, _
ByVal nFileSystemNameSize As Long) As Long

Function GetSerialNumber(DriveLetter As String) As String
Dim SerialNum As Long
Dim VolNameBuf As String
Dim FileSysNameBuf As String
If LCase(DriveLetter) Like _
Left$("[a-z]:\", 4 + Len(DriveLetter)) Then
DriveLetter = DriveLetter & Mid$(":\", Len(DriveLetter))
End If
If Len(GetSerialNumber) = 0 Then
VolNameBuf = String$(255, Chr$(0))
FileSysNameBuf = String$(255, Chr$(0))
GetVolumeInformation DriveLetter, VolNameBuf, _
Len(VolNameBuf), SerialNum, 0, 0, _
FileSysNameBuf, Len(FileSysNameBuf)
GetSerialNumber = Right$("00000000" & Hex$(SerialNum), 8)
End If
End Function

Jul 17 '05 #3
er*****@nowhere.com (J French) wrote in message news:<40***************@news.btclick.com>...
On Fri, 14 May 2004 10:19:02 +0200, "ANSWER" <AN****@ANSWER.com>
wrote:
Hi,

I have developed dictionary (Eng, Ger, Fra, Ita) in Access. The word list
for each is in separate table (Eng_Ger), (Eng_Fra), (Eng_Ita).

I want to protect my dict from unlegal copying with next procedure:

examine and save the serial number of the hard drive using API calls.

Q: Does anybody know this procedure to help me finish this project.


Get the Downloadable API Guide from www.AllAPI.net

Look at the example for: GetVolumeInformation

(The serial number is returned as Decimal, you'll need to look at it
as Hex to prove that it is correct)

I think the premise is flawed here though... apart from the fact that
hard drives can be swapped out and not all are going to have readable
serial numbers if the data is in an MDB database it's going to be easy
for somebody to extract.
Jul 17 '05 #4
On 14 May 2004 10:07:01 -0700, bu*******@earthlink.net (Bob Butler)
wrote:

<snip>

I think the premise is flawed here though... apart from the fact that
hard drives can be swapped out and not all are going to have readable
serial numbers if the data is in an MDB database it's going to be easy
for somebody to extract.


I was just relieved that he was not asking for the serial number of
the physical disk ...
Jul 17 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Raj Batra | last post by:
Hi, I've created a dll that you can import into python. The function calls an ostringstream class. Calling this function repeatedly in python will cause a Microsoft Visual C++ Debug Library...
11
by: Grasshopper | last post by:
Hi, I am automating Access reports to PDF using PDF Writer 6.0. I've created a DTS package to run the reports and schedule a job to run this DTS package. If I PC Anywhere into the server on...
18
by: Method Man | last post by:
If I don't care about the size of my executable or compile time, is there any reason why I wouldn't want to inline every function in my code to make the program run more efficient?
3
by: scott.sara.news | last post by:
I am having major problems accessing some API's and I believe the problem is a 16-bit app. I originally had an application written in Borland Builder C++ 6 (32-bit)that loaded some API's for a...
6
by: ian | last post by:
Hi, I keep resorting to com interop calls, for example I needed the location of the carot in a text box and I had to use a win32API call (GetCarotPos??) to do that. It's one example, I could give...
4
by: Niels Dekker (no reply address) | last post by:
When calling swap as follows (as recommanded in Effective C++, 3rd Edition, by Scott Meyers), what swap is chosen to be called? using std::swap; swap(a, b); Suppose there is a global ::swap...
11
by: GVN | last post by:
Hi All, Can anyone guide me when asynchronous method calls will be benificial? Are there any disadvantages of using asynchronous calls? Thanks,
4
by: archimed7592 | last post by:
Hi. for example i have base class A and dirved class B: struct A { virtual void f() { std::cout << "A::f()" << std::endl; } }; struct B : public A {
1
by: yasinirshad | last post by:
Hi.. how to use joins for 4 tables.. in my query i have CALLS,STATUS,USERS,MESSAGES (4 tables). Query: "SELECT CALLS.CALL_ID, REQUESTOR, USERS.USER_NAME REQUESTOR_NAME, DESCRIPTION, TYPE, SCOPE,...
8
by: Scott M. | last post by:
I've tried following the simple instructions to be able to use MyServices within C#...Add a project reference to Microsoft.VisualBasic.dll and add: "using Microsoft.VisualBasic.MyServices;" to the...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.