| Hrmcobol |
17 de abril de 2015 15:59 |
Obtener numero de serie del Disco Duro (HDD)
Código COBOL:
ENVIRONMENT DIVISION. DATA DIVISION. WORKING-STORAGE SECTION. 01 WE-PARAM IS GLOBAL IS EXTERNAL. 02 WE-PARAM-cad1 PIC x(256). 02 WE-PARAM-cad2 PIC x(256). 02 WE-PARAM-NumS PIC s9(009) comp-5. 02 WE-PARAM-long PIC s9(009) comp-5. 02 WE-PARAM-flag PIC s9(009) comp-5. 02 WE-PARAM-path PIC x(003). 02 WE-PARAM-retc PIC s9(009) comp-5. PROCEDURE DIVISION. call "GetVolumeInformationA" with stdcall linkage using by reference WE-PARAM-path by reference WE-PARAM-cad1 by value 256 by reference WE-PARAM-NumS by value WE-PARAM-long by value WE-PARAM-flag by reference WE-PARAM-cad2 by value 256 returning WE-PARAM-retc end-call * INVOKE pow-self "CloseForm" USING "F-NRODSK" *> 02 WE-PARAM-NumS PIC s9(009) comp-5. <----- Aqui vuelve el numero de serie del rigido *> 02 WE-PARAM-path PIC x(003). <----- Disco a buscar Ej.: C:\
|