api函数ras函数里边有一个
AddConnection("连接名", "", "", username, Password, "")
这样就可以连接。但是他要输入账号和密码
我想问的是。直接使用已有的连接名称。直接来调用。比如我已经有了几个连接。比如是qqq,eee,xxx这些都是我的连接
该怎么作。不能使用shell "rasdial xxx"来调用。
因为我需要返回一个值来判断是不是连接通或者忙。或者其他原因
shell "rasdial qqq" '这样就可以直接调用。。api有没有这样的功能。
调用之后把值付给一个xxx=命令
然后根据xxx的值进行判断是否连接成功或者其他原因。
AddConnection("连接名", "", "", username, Password, "")
这样就可以连接。但是他要输入账号和密码
我想问的是。直接使用已有的连接名称。直接来调用。比如我已经有了几个连接。比如是qqq,eee,xxx这些都是我的连接
该怎么作。不能使用shell "rasdial xxx"来调用。
因为我需要返回一个值来判断是不是连接通或者忙。或者其他原因
shell "rasdial qqq" '这样就可以直接调用。。api有没有这样的功能。
调用之后把值付给一个xxx=命令
然后根据xxx的值进行判断是否连接成功或者其他原因。
我用路由器不好测试,楼主自己试试看。
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
所以只要启动他连接就ok。。好久没来了。结贴先。呵呵。