请教,怎么样在win2000下实现拨号和挂断?
用以前的方法好像只在win98 下用得,2000下好像不行?谁能说说??
win2000的注册表中相应的项和98下不同!

解决方案 »

  1.   

    断开拨号连接
    function DisconnectActiveConnection: Boolean;
    var
      RasEntry: TRasEntry;
      EntryInfoSize: Cardinal;
      DeviceInfoSize: Cardinal;
      RasGetEntryPropertiesResult: Integer;
    begin
      ZeroMemory(@RasEntry, SizeOf(TRasEntry));
      RasEntry.dwSize := SizeOf(TRasEntry);
      EntryInfoSize := SizeOf(TRasEntry);
      RasGetEntryPropertiesResult := RasGetEntryProperties(nil,
    MyActiveEntryName), @RasEntry, EntryInfoSize, nil, DeviceInfoSize);
      if (RasGetEntryPropertiesResult = 0) then
        Result := DisconnectDevice(StrPas(RasEntry.szDeviceName));
    end;
      

  2.   

    winexec('rundll32.exe rnaui.dll,RnaDial '+'我的连接',9),其中我的连接为拨号网络中的名字。
      

  3.   

    winexec('rundll32.exe rnaui.dll,RnaDial '+'我的连接',9),其中我的连接为拨号网络中的名字。 
    上面的方法不行吧!我试了好像2000下是不行的!
      

  4.   

    你试一下这看行不:
    unit Unit1;interfaceuses
      Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
      StdCtrls;type
      TForm1 = class(TForm)
        Button1: TButton;
        procedure Button1Click(Sender: TObject);
      private
        { Private declarations }
      public
        { Public declarations }
      end;var
      Form1: TForm1;implementation{$R *.DFM}procedure TForm1.Button1Click(Sender: TObject);
    var
    Error:integer;
    begin
     Error:=winexec('rundll32.exe rnaui.dll,RnaDial'+'拨号连接因特网',9);
    if Error=0 then
     Showmessage('系统内存耗尽');
    if Error=ERROR_BAD_FORMAT then
     Showmessage('拨号程序是非法32位可执行程序');
    if Error=ERROR_FILE_NOT_FOUND then
      Showmessage('拨号程序么没有找到');
    if Error=ERROR_PATH_NOT_FOUND then
      Showmessage('拨号程序所在路径不正确');end;end.
      

  5.   

    加载rnaui.dll 时出错,找不到指定的模块! ( win2000下)
    没辙了??????
      

  6.   

    NT,2000下有一个命令:Rasdial,你可以看看他的帮助,Rasdial/?  假如你有一个连接是169  ,那么,通过 Rasidal 169 169 169 你可以实现拨好连接,通过Rasdial /disconnect 你可以挂断连接。
      

  7.   

    直接用RasHangUp吧。
    你找一下如何得到当前拨号连接的句柄。。然后用RasHangUp即可