没有合适的资源?快使用搜索试试~ 我知道了~
java tplink
资源推荐
资源详情
资源评论
mport java.io.BufferedReader;
import java.io.InputStreamReader;
public class ConnectNetWork {
/**
* 执行CMD命令,并返回String字符串
*/
public static String executeCmd(String strCmd) throws Exception {
Process p = Runtime.getRuntime().exec("cmd /c " + strCmd);
StringBuilder sbCmd = new StringBuilder();
BufferedReader br = new BufferedReader(new InputStreamReader(p
.getInputStream()));
String line;
while ((line = br.readLine()) != null) {
sbCmd.append(line + "\n");
}
return sbCmd.toString();
}
/**
* 连接ADSL
*/
public static boolean connAdsl(String adslTitle, String adslName, String adslPass) throws Exception {
System.out.println("正在建立连接.");
String adslCmd = "rasdial " + adslTitle + " " + adslName + " "
+ adslPass;
String tempCmd = executeCmd(adslCmd);
// 判断是否连接成功
if (tempCmd.indexOf("已连接") > 0) {
import java.io.InputStreamReader;
public class ConnectNetWork {
/**
* 执行CMD命令,并返回String字符串
*/
public static String executeCmd(String strCmd) throws Exception {
Process p = Runtime.getRuntime().exec("cmd /c " + strCmd);
StringBuilder sbCmd = new StringBuilder();
BufferedReader br = new BufferedReader(new InputStreamReader(p
.getInputStream()));
String line;
while ((line = br.readLine()) != null) {
sbCmd.append(line + "\n");
}
return sbCmd.toString();
}
/**
* 连接ADSL
*/
public static boolean connAdsl(String adslTitle, String adslName, String adslPass) throws Exception {
System.out.println("正在建立连接.");
String adslCmd = "rasdial " + adslTitle + " " + adslName + " "
+ adslPass;
String tempCmd = executeCmd(adslCmd);
// 判断是否连接成功
if (tempCmd.indexOf("已连接") > 0) {
资源评论
马也0925
- 粉丝: 0
- 资源: 2
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功