Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to get Disk Serial Number in fpw26
Message
From
28/11/2001 08:17:37
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
General information
Forum:
Visual FoxPro
Category:
FoxPro 2.x
Miscellaneous
Thread ID:
00586409
Message ID:
00586883
Views:
23
This message has been marked as the solution to the initial question of the thread.
>Hi
>
>Yes i take out the first Function line and save as showser.prg
>i run it as do showser with 'C' and got 2020-2020. I put a
>? mp inside the code and i got a HEART simbol and the
>32
>32
>32
>32
>Disk serial number:is 2020-2020
>
>Is the output from serial.bin on the same MP string??
>
>Is there a way i can check serial.bin is runing ok?
>
>Thank

Run this code to verify correct bytes exist :
lcSerialBin = 'serial.bin' && Full path and name to bin file
x=0
handle=fopen(lcSerialBin)
do while !feof(handle)
 ? asc(fread(handle,1))
 x=x+1
enddo
=fclose(handle)
? x && Should be 12
The values you get should be :
83
184
0
105
139
211
139
31
205
33
91
203

To test if it's working right you need to use debug.exe (when you're unsure what you're doing enter q at prompt to exit) :
debug.exe (You'd get a - prompt). Enter these :
-a100 (You'd get a line with addresses at left, second should read 0100)
mov ax,6900
mov bx,0003
mov dx,0800
int 21
[enter] to get the - prompt again.
-g10B
-des:0800
You should see serial number starting from 3rd byte and also volume label + fat32 (For C drive-mov bx,0003 specifies we want it for 3rd drive).
-q (Exit debugger)


Also check serial.bin content. Go to its dir and run debug again :
debug serial.bin
-u100
You should see :
push bx
mov ax,6900
mov dx,bx
mov bx,[bx]
int 21
pop bx
retf

If not you could enter these as in above sample starting with a100. Then :
-w 100 (it would say writing out 0c bytes)
-q (exit)

Yes mp on return has all the return info. On call we put drive number there as :
(For C drive)
chr(3)+chr(0)+space(22)
On return after first 2 bytes is result. When you print it directly you should see volume label and FAT32.

PS: Don't ask me why 'mp' as varname. I wrote it too many years ago :)
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform