如何用Delphi编写一个程序来执行 网络和拨号连接里的 新建连接???并执行一个拨号连接;;;再线等!!!

解决方案 »

  1.   

    winexec(’rundll32.exe shell32.dll,Control_RunDLL Modem.cpl’,9);
      

  2.   

    应该是winexec('rundll32.exe shell32.dll,Control_RunDLL Telephon.cpl',9);才对,这个才是新建连接的界面!
    procedure TForm.Button1Click(Sender: TObject);
    var 
      x:cardinal;
    begin
      x:=winexec('rundll32.exe shell32.dll,Control_RunDLL Telephon.cpl',9);
      {----------------------调用错误----------------------}
      if x=0 then messagebox(0,'程序超出内存','错误',0);
      if x=ERROR_BAD_FORMAT then messagebox(0,'该程序非一个合法的Win32.EXE程序).','错误',0);
      if x=ERROR_FILE_NOT_FOUND then messagebox(0,'指定文件没找到','错误',0);
      if x=ERROR_PATH_NOT_FOUND then messagebox(0,'指定路径没找到','错误',0);
    end;