Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Running remotelly an application
Message
De
28/07/2003 09:10:51
 
 
À
22/07/2003 15:33:56
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Divers
Thread ID:
00812342
Message ID:
00814070
Vues:
12
Hello Gunnar;
(posted delayed, for a travel reason)

>
>the following code was posted by someone here on UT, but i can not remember who it was (sorry to the developer).
>
>this might help you get the serial from a remote HD. the idea is that you could (temporarly) map the remote drive, get the serial, and then unmap. ofcourse this will only work if something on the remote HD is shared.
>
>******************
>** zGetHDDSerial
>**
>**	returns the last 6 digits of the HDD serial number.
>LOCAL ;
>	lcCurDrive, ;
>	lcHDD, ;
>	lcValue1
>
>lcCurDrive = SUBSTR(SYS(5),1,1) && return current hard drive letter 'c'
>* *** for testing
>*lcCurDrive = "f"
>
>**	return the hard drive serial number
>ofs	= create('scripting.filesystemobject')
>lcHDD	= ALLTRIM(STR(abs(ofs.drives(lcCurDrive).serialnumber)))
>**	get the last 6 digits or pad with '0' if less than 6.
>?lcHDD
>IF LEN(lcHDD) < 6
>	lcHDD = PADR(lcHDD,6,'0')
>ELSE
>	lcHDD = UPPER(SUBSTR(lcHDD,(LEN(lcHDD)-5),6))
>ENDIF
>?lcHDD
>return lcHDD
>
It works fine with the letters F:,G: of our server.. But, If we do the same in other stations (maping the drive of other machines) it doesn't.. lcHDD returns 0 !

Claudio
"Now to him who is able to do immeasurably more than all we ask or imagine, according to his power that is at work within us, Ephesians 3:20
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform