api函数ras函数里边有一个 
AddConnection("连接名", "", "", username, Password, "") 
这样就可以连接。但是他要输入账号和密码 
我想问的是。直接使用已有的连接名称。直接来调用。比如我已经有了几个连接。比如是qqq,eee,xxx这些都是我的连接 
该怎么作。不能使用shell "rasdial xxx"来调用。 
因为我需要返回一个值来判断是不是连接通或者忙。或者其他原因
shell "rasdial qqq" '这样就可以直接调用。。api有没有这样的功能。
调用之后把值付给一个xxx=命令
然后根据xxx的值进行判断是否连接成功或者其他原因。

解决方案 »

  1.   

    试过InternetDial吗,如果这个API可用的话,它会返回一个long,不为0好像就表示拨号成功。
    我用路由器不好测试,楼主自己试试看。
      

  2.   

    RasDial FunctionThe RasDial function establishes a RAS connection between a RAS client and a RAS server. The connection data includes callback and user-authentication information.
    http://msdn.microsoft.com/en-us/library/aa377004(VS.85).aspx
    RasGetConnectStatus FunctionThe RasGetConnectStatus function retrieves information on the current status of the specified remote access connection. An application can use this call to determine when an asynchronous RasDial call is complete.
    http://msdn.microsoft.com/en-us/library/aa377503(VS.85).aspxRasGetConnectionStatistics FunctionThe RasGetConnectionStatistics function retrieves accumulated connection statistics for the specified connection.
    http://msdn.microsoft.com/en-us/library/aa377499(VS.85).aspx
      

  3.   

    我的意思是。我使用的是adsl拨号连接。就是xp这个。正常。我们是双击他。然后就出来一个连接窗口。点连接就上了。
    所以只要启动他连接就ok。。好久没来了。结贴先。呵呵。