home *** CD-ROM | disk | FTP | other *** search
/ Chip 2002 June / Chip_2002-06_cd1.bin / zkuste / delphi / kompon / d56 / MSYSINFO.ZIP / Int / MSI_Network.int < prev    next >
Encoding:
Text File  |  2002-04-05  |  4.3 KB  |  119 lines

  1.  
  2. {*******************************************************}
  3. {                                                       }
  4. {       MiTeC System Information Component              }
  5. {               Network Detection Part                  }
  6. {           version 7.6 for Delphi 5,6                  }
  7. {                                                       }
  8. {       Copyright ⌐ 1997,2002 Michal Mutl               }
  9. {                                                       }
  10. {*******************************************************}
  11.  
  12. {$INCLUDE MITEC_DEF.INC}
  13.  
  14. unit MSI_Network;
  15.  
  16. interface
  17.  
  18. uses
  19.   SysUtils, Windows, Classes, WinSock, MSI_Common, MiTeC_IpHlpAPI;
  20.  
  21. type
  22.   TWinsock = class(TPersistent)
  23.   private
  24.     FDesc: string;
  25.     FStat: string;
  26.     FMajVer: word;
  27.     FMinVer: word;
  28.   public
  29.     procedure GetInfo;
  30.   published
  31.     property Description: string read FDesc {$IFNDEF D6PLUS} write FDesc {$ENDIF} stored False;
  32.     property MajorVersion: word read FMajVer {$IFNDEF D6PLUS} write FMajVer {$ENDIF} stored False;
  33.     property MinorVersion: word read FMinVer {$IFNDEF D6PLUS} write FMinVer {$ENDIF} stored False;
  34.     property Status: string read FStat {$IFNDEF D6PLUS} write FStat {$ENDIF} stored False;
  35.   end;
  36.  
  37.   PAdapter = ^TAdapter;
  38.   TAdapter = record
  39.     Name: string;
  40.     EnableDHCP,
  41.     HaveWINS: boolean;
  42.     IPAddress,
  43.     IPAddressMask,
  44.     Gateway_IPAddress,
  45.     Gateway_IPAddressMask,
  46.     DHCP_IPAddress,
  47.     DHCP_IPAddressMask,
  48.     PrimaryWINS_IPAddress,
  49.     PrimaryWINS_IPAddressMask,
  50.     SecondaryWINS_IPAddress,
  51.     SecondaryWINS_IPAddressMask: TStringList;
  52.   end;
  53.  
  54.   TTCPIP = class(TPersistent)
  55.   private
  56.     FAdapters: TStringList;
  57.     FProxy: boolean;
  58.     FRouting: boolean;
  59.     FDNS: boolean;
  60.     FHost: string;
  61.     FDomain: string;
  62.     FCount: Word;
  63.     procedure ClearList;
  64.     function GetAdapter(Index: Word): TAdapter;
  65.     function GetAdapterCount: Word;
  66.   public
  67.     constructor Create;
  68.     destructor Destroy; override;
  69.     procedure GetInfo;
  70.     procedure Report(var sl :TStringList);
  71.     function FindAdapter(AName: string): Integer;
  72.  
  73.     property Adapter[Index: Word]: TAdapter read GetAdapter;
  74.   published
  75.     property AdapterCount: Word read GetAdapterCount {$IFNDEF D6PLUS} write FCount {$ENDIF} stored False;
  76.     property HostName: string read FHost {$IFNDEF D6PLUS} write FHost {$ENDIF} stored False;
  77.     property DomainName: string read FDomain {$IFNDEF D6PLUS} write FDomain {$ENDIF} stored False;
  78.     property EnableProxy: boolean read FProxy {$IFNDEF D6PLUS} write FProxy {$ENDIF} stored False;
  79.     property EnableRouting: boolean read FRouting {$IFNDEF D6PLUS} write FRouting {$ENDIF} stored False;
  80.     property EnableDNS: boolean read FDNS {$IFNDEF D6PLUS} write FDNS {$ENDIF} stored False;
  81.   end;
  82.  
  83.   TNetwork = class(TPersistent)
  84.   private
  85.     FAdapter: TStrings;
  86.     FWinsock: TWinsock;
  87.     FIPAddress: TStrings;
  88.     FMACAddress: TStrings;
  89.     FCli: TStrings;
  90.     FServ: TStrings;
  91.     FProto: TStrings;
  92.     FNCAI: integer;
  93.     FMode: TExceptionMode;
  94.     FNetCard: string;
  95.     FTCPIP: TTCPIP;
  96.     function GetLocalIP :string;
  97.   public
  98.     constructor Create;
  99.     destructor Destroy; override;
  100.     procedure GetInfo;
  101.     procedure Report(var sl :TStringList);
  102.     property Networkcard: string read FNetCard;
  103.   published
  104.     property ExceptionMode: TExceptionMode read FMode write FMode;
  105.     property IPAddresses: TStrings read FIPAddress {$IFNDEF D6PLUS} write FIPAddress {$ENDIF} stored false;
  106.     property MACAddresses: TStrings read FMACAddress {$IFNDEF D6PLUS} write FMACAddress {$ENDIF} stored False;
  107.     property Adapters :TStrings read FAdapter {$IFNDEF D6PLUS} write FAdapter {$ENDIF} stored false;
  108.     property CardAdapterIndex: integer read FNCAI {$IFNDEF D6PLUS} write FNCAI {$ENDIF} stored False;
  109.     property Protocols :TStrings read FProto {$IFNDEF D6PLUS} write FProto {$ENDIF} stored False;
  110.     property Services :TStrings read FServ {$IFNDEF D6PLUS} write FServ {$ENDIF} stored False;
  111.     property Clients :TStrings read FCli {$IFNDEF D6PLUS} write FCli {$ENDIF} stored False;
  112.     property WinSock: TWinsock read FWinsock {$IFNDEF D6PLUS} write FWinsock {$ENDIF} stored false;
  113.     property TCPIP: TTCPIP read FTCPIP {$IFNDEF D6PLUS} write FTCPIP {$ENDIF} stored False;
  114.   end;
  115.  
  116. implementation
  117.  
  118.  
  119.