Форум: "Система";
Текущий архив: 2003.08.25;
Скачать: [xml.tar.bz2];
ВнизДанные о железе и системе Найти похожие ветки
← →
Explorer (2003-06-06 09:10) [0]Мастера!
Стоит задача написания приложения по паспортизации компьютеров на предприятии, т.е. учет комп. (их "начинка",комплектующие,ПО).
Может кто-нибудь делал подобное или подскажит ссылки на доки?
Интересует извлечение данных о CPU, HDD,..., сеть (IP, протоколы) версия ОС, и т.д., с последующим занесением в БД.
← →
Spawn (2003-06-06 10:12) [1]с HDD - GetVolumeInformation
c версией ОС - можно использовать все готовое, т.е. юзаешь можуль SysUtils, а именно смотри переменные Win32Platform, Win32MajorVersion, Win32MinorVersion, Win32BuildNumber, Win32CSDVersion. (Хотя можно и на АПИ - GetWindowMajorVersion, GetWindowMinorVersion и т.д.)
протоколы - EnumProtocols(WSAEnumProtocols), для извлечения своего IP смотри WinSock API
← →
Explorer (2003-06-06 14:13) [2]Как узнать наличие:
1. USB
2. CD-rom
3. FDD
4. CPU - частота, произ. (Intel,AMD)
5. Video - объем, произв-ль
6. RAM - тип (EDO,DDR..), объем
7. SCSI
8. Пакет Office - версия, установлен. компоненты
← →
DC-AC (2003-06-06 15:14) [3]Видел такой компонент - MSystemInfo называется.
З.Ы. А вообще-то всё есть в реестре, ищите...
З.З.Ы А сколько у вас компов-то ? 33 тысячи штук что ли ? В своё время, когда работал на ВЦ одного химкомбината, процесс переписи конфигурации одного компа "ручками" занимал 5 минут...
← →
Spawn (2003-06-06 15:35) [4]Скорость процессора (из коллекции компонентов):
function GetCPUSpeed: Double;
const
DelayTime = 500; // measure time in ms
var
TimerHi, TimerLo: DWORD;
PriorityClass, Priority: Integer;
begin
PriorityClass := GetPriorityClass(GetCurrentProcess);
Priority := GetThreadPriority(GetCurrentThread);
SetPriorityClass(GetCurrentProcess, REALTIME_PRIORITY_CLASS);
SetThreadPriority(GetCurrentThread, THREAD_PRIORITY_TIME_CRITICAL);
Sleep(10);
asm
dw 310Fh // rdtsc
mov TimerLo, eax
mov TimerHi, edx
end;
Sleep(DelayTime);
asm
dw 310Fh // rdtsc
sub eax, TimerLo
sbb edx, TimerHi
mov TimerLo, eax
mov TimerHi, edx
end;
SetThreadPriority(GetCurrentThread, Priority);
SetPriorityClass(GetCurrentProcess, PriorityClass);
Result := TimerLo / (1000.0 * DelayTime);
end;
//Тип диска и его параметры
type
TDriveStyle = (tUnknown, tNoDrive, t3Floppy, t5Floppy, tFixed, tRFixed,tNetwork, tCDROM, tTape);
PDeviceParams = ^TDeviceParams;
TDeviceParams = record
bSpecFunc: byte; {Special functions}
bDevType: byte; {Device type}
wDevAttr: word; {Device attributes}
wCylinders: word; {Number of cylinders}
bMediaType: byte; {Media type}
{ Beginning of BIOS parameter block (BPB)}
wBytesPerSec: word; {Bytes per sector}
bSecPerClust: byte; {Sectors per cluster}
wResSectors: word; {Number of reserved sectors}
bFATs: byte; {Number of FATs}
wRootDirEnts: word; {Number of root-directory entries}
wSectors: word; {Total number of sectors}
bMedia: byte; {Media descriptor}
wFATsecs: word; {Number of sectors per FAT}
wSecPerTrack: word; {Number of sectors per track}
wHeads: word; {Number of heads}
dwHiddenSecs: longInt; {Number of hidden sectors}
dwHugeSectors: longInt; {Number of sectors if wSectors == 0}
reserved: array[0..10] of char;
{ End of BIOS parameter block (BPB)}
end;
function GetDeviceParameters(wDrive: word; var dp: TDeviceParams): boolean;
begin
result := TRUE; {Assume success}
asm
push ds
mov bx, wDrive
mov ch, 08h {Device category--must be 08h}
mov cl, 60h {MS-DOS IOCTL Get Device Parameters}
lds dx, dp
mov ax, 440Dh
int 21h
jnc @gdp_done {CF SET if error}
mov result, FALSE
@gdp_done:
pop ds
end;
end;
function GetDefaultDrive: word; assembler;
asm
mov ah, 19h {convert default to real}
int 21h
xor ah, ah {clear hi byte}
end;
{Determine id drive is a CDROM, 0=default, 1=A ...}
function IsCDROMDrive(wDrive: word): boolean; assembler;
var
wTempDrive: word;
asm
mov ax, wDrive
or ax, ax
jnz @not_default
mov ah, 19h {convert default to drive}
int 21h
xor ah, ah
mov wTempDrive, ax
jmp @test_it
@not_default: {zero base it}
dec ax
mov wTempDrive, ax
@test_it:
mov ax, 1500h {first test for presence of MSCDEX}
xor bx, bx
int 2fh
mov ax, bx {MSCDEX is not there if bx is zero}
or ax, ax {so return FALSE}
jz @no_mscdex
mov ax, 150bh {MSCDEX driver check API}
mov cx, wTempDrive {...cx is drive index}
int 2fh
or ax, ax
@no_mscdex:
end;
function GetDriveStyle(wDrive: word): TDriveStyle;
var
x: word;
wTempDrive: word;
dp: TDeviceParams;
begin
{convert default to drive}
if wDrive = 0
then wTempDrive := GetDefaultDrive
else wTempDrive := wDrive - 1;
x := GetDriveType(wTempDrive);
{get types}
case x of
drive_Removable: begin
dp.bSpecFunc := 0; {need to clear this}
if GetDeviceParameters(wDrive,dp) then begin
case dp.bDevType of
0,1: result := t5floppy; {320K/360K/1.2M}
2,7,9: result := t3floppy; {720K/1.44M/2.88M}
5: result := tRFixed; {yes a removable fixed drive!}
6: result := tTape; {tape}
else result := tUnknown;
end;
end
else result := tUnknown;
end;
drive_Fixed:
if IsCDROMDrive(wDrive)
then result := tCDROM
else result := tFixed;
drive_Remote:
if IsCDROMDrive(wDrive) {I think this is possible on a network!}
then result := tCDROM
else result := tNetWork;
else result := tUnknown;
end;
end;
Узнать все про Мемори поможет - GlobalMemoryStatus();
← →
Spawn (2003-06-06 15:41) [5]/////////////////////////SCSI//////////////////////////////
unit wnaspi32;
//unit wnaspi32.h version ?.??
//translation version 1.0
//compatible with Delphi 2.0-4.0
//by daNIL,danila@starlab.ifmo.ru
//please, send me any comments or suggestions
//about this file
(****************************************************************************
* *
* THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY *
* KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE *
* IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR *
* PURPOSE. *
* *
* Copyright (C) 1993-95 Microsoft Corporation. All Rights Reserved. *
* *
****************************************************************************)
//***************************************************************************
//
// Name: WNASPI32.H
//
// Description: ASPI for Win32 definitions ("C" Language)
//
//***************************************************************************
interface
uses Windows;
//typedef void *LPSRB;
//typedef void (*PFNPOST)();???????
type LPSRB = Pointer;
function SendASPI32Command(LPSRB:Pointer):DWORD;cdecl;
function GetASPI32SupportInfo:DWORD;cdecl;
const
SENSE_LEN = 14; // Default sense buffer length
SRB_DIR_SCSI = $00; // Direction determined by SCSI command
SRB_DIR_IN = $08; // Transfer from SCSI target to host
SRB_DIR_OUT = $10; // Transfer from host to SCSI target
SRB_POSTING = $01; // Enable ASPI posting
SRB_EVENT_NOTIFY = $40; // Enable ASPI event notification
SRB_ENABLE_RESIDUAL_COUNT = $04; // Enable residual byte count reporting
SRB_DATA_SG_LIST = $02; // Data buffer points to scatter-gather list
WM_ASPIPOST = $4D42; // ASPI Post message
//***************************************************************************
// %%% ASPI Command Definitions %%%
//***************************************************************************
SC_HA_INQUIRY = $00; // Host adapter inquiry
SC_GET_DEV_TYPE = $01; // Get device type
SC_EXEC_SCSI_CMD = $02; // Execute SCSI command
SC_ABORT_SRB = $03; // Abort an SRB
SC_RESET_DEV = $04; // SCSI bus device reset
SC_GET_DISK_INFO = $06; // Get Disk information
//***************************************************************************
// %%% SRB Status %%%
//***************************************************************************
SS_PENDING = $00; // SRB being processed
SS_COMP = $01; // SRB completed without error
SS_ABORTED = $02; // SRB aborted
SS_ABORT_FAIL = $03; // Unable to abort SRB
SS_ERR = $04; // SRB completed with error
SS_INVALID_CMD = $80; // Invalid ASPI command
SS_INVALID_HA = $81; // Invalid host adapter number
SS_NO_DEVICE = $82; // SCSI device not installed
SS_INVALID_SRB = $E0; // Invalid parameter set in SRB
SS_FAILED_INIT = $E4; // ASPI for windows failed init
SS_ASPI_IS_BUSY = $E5; // No resources available to execute cmd
SS_BUFFER_TO_BIG = $E6; // Buffer size to big to handle!
//***************************************************************************
// %%% Host Adapter Status %%%
//***************************************************************************
HASTAT_OK = $00; // Host adapter did not detect an // error
HASTAT_SEL_TO = $11; // Selection Timeout
HASTAT_DO_DU = $12; // Data overrun data underrun
HASTAT_BUS_FREE = $13; // Unexpected bus free
HASTAT_PHASE_ERR = $14; // Target bus phase sequence // failure
HASTAT_TIMEOUT = $09; // Timed out while SRB was waiting to beprocessed.
HASTAT_COMMAND_TIMEOUT = $0B; // While processing the SRB, the
// adapter timed out.
HASTAT_MESSAGE_REJECT = $0D; // While processing SRB, the
← →
Spawn (2003-06-06 15:43) [6]//adapter received a MESSAGE // REJECT.
HASTAT_BUS_RESET = $0E; // A bus reset was detected.
HASTAT_PARITY_ERROR = $0F; // A parity error was detected.
HASTAT_REQUEST_SENSE_FAILED = $10; // The adapter failed in issuing
// REQUEST SENSE.
//***************************************************************************
// %%% SRB - HOST ADAPTER INQUIRY - SC_HA_INQUIRY %%%
//***************************************************************************
type
SRB_HAInquiry = record
SRB_Cmd, // ASPI command code = SC_HA_INQUIRY
SRB_Status, // ASPI command status byte
SRB_HaId, // ASPI host adapter number
SRB_Flags:BYTE; // ASPI request flags
SRB_Hdr_Rsvd:DWORD; // Reserved, MUST = 0
HA_Count, // Number of host adapters present
HA_SCSI_ID, // SCSI ID of host adapter
HA_ManagerId, // String describing the manager
HA_Identifier, // String describing the host adapter
HA_Unique:array[0..15]of byte; // Host Adapter Unique parameters
HA_Rsvd1:WORD;
end;
PSRB_HAInquiry = ^SRB_HAInquiry;
TSRB_HAInquiry = SRB_HAInquiry;
//***************************************************************************
// %%% SRB - GET DEVICE TYPE - SC_GET_DEV_TYPE %%%
//***************************************************************************
SRB_GDEVBlock = record
SRB_Cmd, // ASPI command code = SC_GET_DEV_TYPE
SRB_Status, // ASPI command status byte
SRB_HaId, // ASPI host adapter number
SRB_Flags:BYTE; // Reserved
SRB_Hdr_Rsvd:DWORD; // Reserved
SRB_Target, // Target"s SCSI ID
SRB_Lun, // Target"s LUN number
SRB_DeviceType, // Target"s peripheral device type
SRB_Rsvd1:BYTE;
end;
TSRB_GDEVBlock = SRB_GDEVBlock;
PSRB_GDEVBlock = ^SRB_GDEVBlock;
//***************************************************************************
// %%% SRB - EXECUTE SCSI COMMAND - SC_EXEC_SCSI_CMD %%%
//***************************************************************************
SRB_ExecSCSICmd = record
SRB_Cmd, // ASPI command code = SC_EXEC_SCSI_CMD
SRB_Status, // ASPI command status byte
SRB_HaId, // ASPI host adapter number
SRB_Flags:BYTE; // ASPI request flags
SRB_Hdr_Rsvd:DWORD; // Reserved
SRB_Target, // Target"s SCSI ID
SRB_Lun:BYTE; // Target"s LUN number
SRB_Rsvd1:WORD; // Reserved for Alignment
SRB_BufLen:DWORD; // Data Allocation Length
SRB_BufPointer:Pointer; // Data Buffer Pointer
SRB_SenseLen, // Sense Allocation Length
SRB_CDBLen, // CDB Length
SRB_HaStat, // Host Adapter Status
SRB_TargStat:BYTE; // Target Status
SRB_PostProc, // Post routine
SRB_Rsvd2:Pointer; // Reserved
SRB_Rsvd3, // Reserved for alignment
CDBByte:array[0..15]of byte; // SCSI CDB
SenseArea:array[0..SENSE_LEN+1]of byte; // Request Sense buffer
end;
TSRB_ExecSCSICmd = SRB_ExecSCSICmd;
PSRB_ExecSCSICmd = ^SRB_ExecSCSICmd;
//***************************************************************************
// %%% SRB - ABORT AN SRB - SC_ABORT_SRB %%%
//***************************************************************************
SRB_Abort = record
SRB_Cmd, // ASPI command code = SC_EXEC_SCSI_CMD
SRB_Status, // ASPI command status byte
SRB_HaId, // ASPI host adapter number
SRB_Flags:BYTE; // Reserved
SRB_Hdr_Rsvd:DWORD; // Reserved
SRB_ToAbort:Pointer; // Pointer to SRB to abort
end;
TSRB_Abort = SRB_Abort;
PSRB_Abort = ^SRB_Abort;
← →
Spawn (2003-06-06 15:45) [7]/////////////////////Конец/////////////////////////////////
//***************************************************************************
// %%% SRB - BUS DEVICE RESET - SC_RESET_DEV %%%
//***************************************************************************
SRB_BusDeviceReset = record
SRB_Cmd, // ASPI command code = SC_EXEC_SCSI_CMD
SRB_Status, // ASPI command status byte
SRB_HaId, // ASPI host adapter number
SRB_Flags:BYTE; // Reserved
SRB_Hdr_Rsvd:DWORD; // Reserved
SRB_Target, // Target"s SCSI ID
SRB_Lun:BYTE; // Target"s LUN number
SRB_Rsvd1:array[0..11]of byte; // Reserved for Alignment
SRB_HaStat, // Host Adapter Status
SRB_TargStat:BYTE; // Target Status
SRB_PostProc, // Post routine
SRB_Rsvd2:Pointer; // Reserved
SRB_Rsvd3, // Reserved
CDBByte:array[0..15]of byte; // SCSI CDB
end;
TSRB_BusDeviceReset = SRB_BusDeviceReset;
PSRB_BusDeviceReset = ^SRB_BusDeviceReset;
//***************************************************************************
// %%% SRB - GET DISK INFORMATION - SC_GET_DISK_INFO %%%
//***************************************************************************
SRB_GetDiskInfo = record
SRB_Cmd, // ASPI command code = SC_EXEC_SCSI_CMD
SRB_Status, // ASPI command status byte
SRB_HaId, // ASPI host adapter number
SRB_Flags:BYTE; // Reserved
SRB_Hdr_Rsvd:DWORD; // Reserved
SRB_Target, // Target"s SCSI ID
SRB_Lun, // Target"s LUN number
SRB_DriveFlags, // Driver flags
SRB_Int13HDriveInfo, // Host Adapter Status
SRB_Heads, // Preferred number of heads translation
SRB_Sectors:BYTE; // Preferred number of sectors translation
SRB_Rsvd1:array[0..9]of byte; // Reserved
end;
TSRB_GetDiskInfo = SRB_GetDiskInfo;
PSRB_GetDiskInfo = ^SRB_GetDiskInfo;
implementation
const WNASPI = "wnaspi32.dll";
function SendASPI32Command;external WNASPI name "SendASPI32Command";
function GetASPI32SupportInfo;external WNASPI name "GetASPI32SupportInfo";
////////////////////////////////////////////////////////////////
Данные Офиса, возможно, можно в реестре узнать.
← →
E_Dimon (2003-06-07 00:17) [8]Данные обо всем оборудовании ,когда либо устанавливаемом на компьютере ,хранятся в реестре по адресу HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Class
у каждого ключа есть значение DriverDesc - описание и MatchingDeviceId, которое ссылается на ключ в HKEY_DYN_DATA\Config Manager\Enum с таким же значением HardWareKey
И как , понятно?
← →
Explorer (2003-06-09 09:47) [9]>DC-AC ( 110 Euro!) >DC-AC
полнофункциональная MSystemInfo стала платная(110 Euro!)
>Spawn © E_Dimon ©
Спасибо!теперь попробую все это применить!
← →
DC-AC (2003-06-09 12:00) [10]Explorer : могу выслать на мыло то, что у меня есть. 383 кило в зипе.
File: msysinfo.zip
Product: MiTeC SysInfo
Version: 4.1
Author: MichaL MutL
E-Mail: michal.mutl@atlas.cz
Target: Delphi 2.x, Delphi 3.x, Delphi 4.x, Delphi 5.x
Platform: W95, W98, NT, W2000
Status: Fully Functional
Source: Included
Description: Component providing detailed system information
← →
Explorer (2003-06-09 14:28) [11]>DC-AC
а под D7 она встанет?
Если да, то буду признателен!
← →
DC-AC (2003-06-10 08:48) [12]Explorer : а х.з., у меня во-первых Delphi5 (мощности машины не хватает на большее), во-вторых я не устанавливал этот компонент вообще, а лишь разбирался с его исходниками. Если нужно будет - напрши на мыло, вышлю.
← →
Explorer (2003-06-10 14:29) [13]>DC-AC - лады
А кто-нибудь юзал MiTeC SysInfo ver.8?
хотелось бы узнать, как можно сохранить результаты в *.xml, а то просмотрщик с ним идет *.xml, но как создавать отчеты не въехал?
Страницы: 1 вся ветка
Форум: "Система";
Текущий архив: 2003.08.25;
Скачать: [xml.tar.bz2];
Память: 0.53 MB
Время: 0.011 c