如题!!

解决方案 »

  1.   

    查注冊表首先看看你的MODEM在注冊表的什麼位置,找出其規律即可知
      

  2.   

    老大,有没有其它方法,我觉得查注册表不通用!!
    在2K下和在XP或其它系统下可能都不一样的!
      

  3.   

    猛料里有一个例子,不过有点问题,我改了一下:unit Unit1;interfaceuses
      Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
      Dialogs, StdCtrls;const
      RAS_MaxDeviceType     = 16;
      RAS_MaxDeviceName     = 128;  RASBASE = 600;
      ERROR_BUFFER_TOO_SMALL = (RASBASE+3);type
      TForm1 = class(TForm)
        Button1: TButton;
        Memo1: TMemo;
        procedure Button1Click(Sender: TObject);
      private
        { Private declarations }
      public
        { Public declarations }
      end;LpRasDevInfo = ^TRasDevInfo;
    TRasDevInfo = record
        dwSize       : Longint;
        szDeviceType : Array[0..RAS_MaxDeviceType] of AnsiChar;
        szDeviceName : Array[0..RAS_MaxDeviceName] of AnsiChar;
    end;function RasEnumDevices(lpRasDevInfo :LpRasDevInfo;
      lpcb: LPDWORD;lpcdevices: LPDWORD): DWORD;
    stdcall; external 'RASAPI32.dll' name 'RasEnumDevicesA';
    var
      Form1: TForm1;implementation{$R *.dfm}procedure TForm1.Button1Click(Sender: TObject);
    var
        buffer: Pointer;
        devices: LPRasDevInfo;
        devSize, ndevs: Integer;
    begin
        devSize := 0;
        ndevs := 0;
        if RasEnumDevices(nil, @devSize, @ndevs) <> ERROR_BUFFER_TOO_SMALL then
          ShowMessage('RasEnumDevices failed.');    buffer := AllocMem(devSize);
        try
          devices := buffer;
          devices^.dwSize := SizeOf(TRasDevInfo);
          if RasEnumDevices(buffer, @devSize, @ndevs) = 0 then
          begin
            while ndevs > 0 do
            begin        if string(devices^.szDeviceType)='modem' then
            Memo1.Lines.Add(Format('%s=%s', [devices^.szDeviceName, devices^.szDeviceType]));        Inc(devices);
            Dec(ndevs);
            end;
          end
          else
            ShowMessage('RasEnumDevices failed.');
        finally
          FreeMem(buffer);
        end;
        end;
    end.