IONOUTPARAMS(); uint bytRv = 0; if (0 != DeviceIoControl(device, DFP_GET_VERSION, 0, 0, ref verPara, MSizeOf(verPara), ref bytRv, 0)) { if (verPbIDEDeviceMap > 0) { byte bIDCmd = (byte)(((verPbIDEDeviceMap >> drive & 0x10) != 0) ? IDE_ATAPI_IDENTIFY : IDE_ATA_IDENTIFY); SENDCMDINPARAMS scip = new SENDCMDINPARAMS(); SENDCMDOUTPARAMS scop = new SENDCMDOUTPARAMS(); BufferSize = IDENTIFY_BUFFER_SIZE; irDriveRbFeaturesReg = 0; irDriveRbSectorCountReg = 1; irDriveRbCylLowReg = 0; irDriveRbCylHighReg = 0; irDriveRbDriveHeadReg = (byte)(0xA0 | ((drive & 1) << 4)); irDriveRbCommandReg = bIDCmd; bDriveNumber = drive; if (0 != DeviceIoControl(device, DFP_RECEIVE_DRIVE_DATA, ref scip, MSizeOf(scip), ref scop, MSizeOf(scop), ref bytRv, 0)) { StringBuilder s = new StringBuilder(); for (int i = 20; i < 40; i += 2) { Append((char)(bBuffer[i+1])); Append((char)bBuffer[i]); } CloseHandle(device); return ToString()Trim(); } } } CloseHandle(device); return ""; } } 文章出处: _webprogram//asp_netshl/200727/12910_html