Hola a todos,
Alguien prodría probar está función? El parámetro que recibe es la letra de una unidad USB.
En W2000 a mi no me funciona, no entra en el 'For each oJob in oJobs'.
Utilizo Harbour y FWH 8.03.
Saludos y gracias
Carlos G.
Este es el código:
/* ********************************** */
STATIC FUNCTION GetUSBSerial( cDrive )
Local oLoc := CreateObject( "wbemScripting.SwbemLocator" )
Local oSrv := oLoc:ConnectServer()
Local oJobs := oSrv:ExecQuery( "SELECT * FROM Win32_LogicalDiskToPartition" )
Local oJob
Local cDriveNumber
cDrive = Upper( cDrive )
If Len( cDrive ) == 1
cDrive += ":"
Endif
If Len( cDrive ) > 2
cDrive = SubStr( cDrive, 1, 2 )
Endif
For each oJob in oJobs
If cDrive == StrToken( oJob:Dependent, 2, '"' )
cDriveNumber = SubStr( StrToken( StrToken( oJob:Antecedent, 2, '"' ), 1, "," ), 7 )
return GetSerial( oSrv, cDriveNumber )
Endif
Next
Return ""
/* ********************************** */
USB en W2000 SP2
Return to “FiveWin para Harbour/xHarbour”
Jump to
- English Forums
- ↳ FiveWin for CA-Clipper
- ↳ FiveWin for Harbour/xHarbour
- ↳ FiveTouch
- ↳ EasyReport, EasyDialog and EasyPreview
- ↳ FiveMac / FivePhone (iPhone, iPad)
- ↳ FiveLinux / FiveDroid (Android)
- ↳ FiveWin for Pocket PC
- ↳ mod_harbour
- Foros en Español
- ↳ FiveWin para CA-Clipper
- ↳ FiveWin para Harbour/xHarbour
- ↳ FiveTouch
- ↳ EasyReport, EasyDialog y EasyPreview
- ↳ FiveMac / FivePhone (iPhone, iPad)
- ↳ FiveLinux / FiveDroid (Android)
- ↳ FiveWin para Pocket PC
- ↳ mod_harbour
- Forum italiani
- ↳ All products support
- Forum Portuguese
- ↳ All products support
- Forum German
- ↳ All products support
- General
- ↳ WhatsNew / Novedades
- ↳ Bugs report & fixes / Informe de errores y arreglos
- ↳ To do - WishList / Por hacer - Peticiones
- ↳ Utilities / Utilidades
- ↳ Off Topic / Otros temas
- Artificial Intelligence
- ↳ TensorFlow and Python examples
- ↳ TensorFlow.dll for Harbour and FWH
- ↳ latest AI news
- ↳ Building TensorFlow.dll
- ↳ AI Introduction (Harbour code and samples)