Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Copy protection
Message
De
19/10/2012 13:57:55
 
 
À
18/10/2012 07:56:21
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
Information générale
Forum:
Visual FoxPro
Catégorie:
Installation et configuration
Titre:
Divers
Thread ID:
01555192
Message ID:
01555356
Vues:
91
>>Hello Hilmar,
>>
>>If you find a solution (either here or elsewhere) to this problem could you please let me know about it. I do the same thing with an app.
>>
>>Thanks.
>
>Such a solution seems to be quite elusive; so far I have seen the following problems: (1) higher security settings in Windows 7 - the reason I started this thread, and (2) virtual machines, as mentioned in this thread, are a new problem I hadn't seriously thought about before.

Here's what I've been using for some time
FUNCTION DiskSerial

LPARAMETER cDisk

DECLARE SHORT GetVolumeInformation IN Win32API ;
        STRING wroot, ;
        STRING wnombuf, ;
        LONG wnomsize, ;
        STRING wnumero, ;
        STRING wmx, ;
        STRING wflag, ;
        STRING wsysbuf, ;
        INTEGER wsyssize

LOCAL wroot, wnombuf, wnumero, wmx
LOCAL wflag, wsysbuf, wnomsize, wsyssize
LOCAL n1,n2,n3,n4, w1,w2,w3,w4

wroot = IIF(EMPTY(cDisk), SYS(5), cDisk + ':') + "\" && disque courant
wnombuf = SPACE(255)
wnumero = SPACE(10)
wmx = SPACE(255)
wflag = SPACE(255)
wsysbuf = SPACE(255)
wnomsize = 255
wsyssize = 255

GetVolumeInformation (wroot, @wnombuf, @wnomsize, @wnumero, ;
                      @wmx, @wflag, @wsysbuf, @wsyssize)

n4 = ASC(SUBSTR(wnumero,1,1))
n3 = ASC(SUBSTR(wnumero,2,1))
n2 = ASC(SUBSTR(wnumero,3,1))
n1 = ASC(SUBSTR(wnumero,4,1))

w1 = TRANSFORM(n1,'@0')
w2 = TRANSFORM(n2,'@0')
w3 = TRANSFORM(n3,'@0')
w4 = TRANSFORM(n4,'@0')


RETURN ;
	RIGHT(w1,2) +;
	RIGHT(w2,2) +;
	"-"         +;
	RIGHT(w3,2) +;
	RIGHT(w4,2)
No problems so far.
*******************************************************
Save a tree, eat a beaver.
Denis Chassé
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform