欧美一区二区三区老妇人-欧美做爰猛烈大尺度电-99久久夜色精品国产亚洲a-亚洲福利视频一区二区

撥號(hào)代碼java 撥號(hào)代碼691什么意思

有沒(méi)有大神會(huì)寫(xiě)在linux下的用java實(shí)現(xiàn)寬帶的撥號(hào)程序

package cn.adsl;

創(chuàng)新互聯(lián)公司專(zhuān)業(yè)為企事業(yè)單位提供成都網(wǎng)站建設(shè)公司、成都網(wǎng)站設(shè)計(jì),網(wǎng)站優(yōu)化、微信開(kāi)發(fā)、手機(jī)網(wǎng)站建設(shè)、空間域名、網(wǎng)頁(yè)空間、企業(yè)郵箱等互聯(lián)網(wǎng)基礎(chǔ)服務(wù)。成立與2013年,我們先后簽約上千多家中小型企業(yè)和科技發(fā)展公司的網(wǎng)站建設(shè)和網(wǎng)站推廣項(xiàng)目。通過(guò)多年的創(chuàng)新發(fā)展,已發(fā)展成為專(zhuān)業(yè)能力較強(qiáng),服務(wù)較好的建站公司。

import java.io.BufferedReader;

import java.io.InputStreamReader;

public class ConnectNetWork {

/**

* 執(zhí)行CMD命令,并返回String字符串

*

* @param strCmd

* @return

* @throws Exception

*/

public static String exeCmd(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 = null;

while ((line = br.readLine()) != null) {

sbCmd.append(line + "\n");

}

return sbCmd.toString();

}

/**

* 切斷ADSL

*

* @param adslTitle

* @return

* @throws Exception

*/

public static boolean cutAdsl(String adslTitle) throws Exception {

// 加上"" 防止空格

String cutAdsl = "rasdial \"" + adslTitle + "\" /disconnect";

String result = exeCmd(cutAdsl);

if (result.indexOf("沒(méi)有連接") != -1) {

System.err.println(adslTitle + "連接不存在!");

return false;

} else {

System.out.println("連接已斷開(kāi)");

return true;

}

}

/**

* 連接ADSL

*

* @param adslTitle

* @param adslName

* @param adslPass

* @param adslPhone

* @return

* @throws Exception

*/

public static boolean connAdsl(String adslTitle, String adslName,

String adslPass, String adslPhone) throws Exception {

// 加上"" 防止空格

String adslCmd = "rasdial \"" + adslTitle + "\" " + adslName + " "

+ adslPass + " /phone:" + adslPhone;

String tempCmd = exeCmd(adslCmd);

if (tempCmd.indexOf("已連接") 0) {

System.out.println("已成功建立連接.");

return true;

} else {

System.err.println(tempCmd);

System.err.println("建立連接失敗");

return false;

}

}

/**

* @param args

*/

public static void main(String[] args) throws Exception {

// rasdial "寬帶名" /disconnect

String adsl = "寬帶名";

String username = "username";

String password = "password";

String phone = "#12345678";

cutAdsl(adsl);

Thread.sleep(4000);

// rasdial "寬帶名" 用戶名 密碼 /phone:#123456789

connAdsl(adsl, username, password, phone);

}

}

大神用java寫(xiě)寬帶撥號(hào) 怎么寫(xiě)啊 能不能教下我

package cn.adsl;

import java.io.BufferedReader;

import java.io.InputStreamReader;

public class ConnectNetWork {

/**

* 執(zhí)行CMD命令,并返回String字符串

*

* @param strCmd

* @return

* @throws Exception

*/

public static String exeCmd(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 = null;

while ((line = br.readLine()) != null) {

sbCmd.append(line + "\n");

}

return sbCmd.toString();

}

/**

* 切斷ADSL

*

* @param adslTitle

* @return

* @throws Exception

*/

public static boolean cutAdsl(String adslTitle) throws Exception {

// 加上"" 防止空格

String cutAdsl = "rasdial \"" + adslTitle + "\" /disconnect";

String result = exeCmd(cutAdsl);

if (result.indexOf("沒(méi)有連接") != -1) {

System.err.println(adslTitle + "連接不存在!");

return false;

} else {

System.out.println("連接已斷開(kāi)");

return true;

}

}

/**

* 連接ADSL

*

* @param adslTitle

* @param adslName

* @param adslPass

* @param adslPhone

* @return

* @throws Exception

*/

public static boolean connAdsl(String adslTitle, String adslName,

String adslPass, String adslPhone) throws Exception {

// 加上"" 防止空格

String adslCmd = "rasdial \"" + adslTitle + "\" " + adslName + " "

+ adslPass + " /phone:" + adslPhone;

String tempCmd = exeCmd(adslCmd);

if (tempCmd.indexOf("已連接") 0) {

System.out.println("已成功建立連接.");

return true;

} else {

System.err.println(tempCmd);

System.err.println("建立連接失敗");

return false;

}

}

/**

* @param args

*/

public static void main(String[] args) throws Exception {

// rasdial "寬帶名" /disconnect

String adsl = "寬帶名";

String username = "username";

String password = "password";

String phone = "#12345678";

cutAdsl(adsl);

Thread.sleep(4000);

// rasdial "寬帶名" 用戶名 密碼 /phone:#123456789

connAdsl(adsl, username, password, phone);

}

}

我想要一個(gè)寬帶撥號(hào)的Java代碼實(shí)現(xiàn) 可以在Eclipse里面運(yùn)行的 就是那種普通的PPPOE連接上網(wǎng) 輸入賬號(hào)密碼

這個(gè)要底層操作的吧,Java 做比較難吧, 但是 Runtime 調(diào)用本地的連接程序還可以試下 。

網(wǎng)站名稱(chēng):撥號(hào)代碼java 撥號(hào)代碼691什么意思
網(wǎng)站路徑:http://chinadenli.net/article18/ddodddp.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供電子商務(wù)動(dòng)態(tài)網(wǎng)站企業(yè)網(wǎng)站制作服務(wù)器托管自適應(yīng)網(wǎng)站定制開(kāi)發(fā)

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來(lái)源: 創(chuàng)新互聯(lián)

網(wǎng)站優(yōu)化排名