亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? msg.java

?? 手機短信編程的源代碼
?? JAVA
字號:
// Useful tools for the communication with the mobile phone//// file:    Msg.java// used by: SMS.java//// For comments see header of SMS.java.//---------------------------------------------------------------------------------------package smspack;import java.io.*;import java.rmi.*;import java.util.*;import javax.comm.*;class Msg {  private static String portName;  private static SerialPort port;  private static OutputStreamWriter out;  private static InputStreamReader in;  private static String number;  private static String message;  private static boolean numbertype;       // national or international dialing number  /** sends a SMS over the mobile phone to the GSM network   * @param dialno dialing number of the destionation   * @param notype national/international dialing number   * @param smstext SMS to send   * @throws java.rmi.RemoteException   */  public static void sendSMS(String dialno, boolean notype, String smstext)    throws java.rmi.RemoteException {    //----- message will be restricted to 160 characters    if (smstext.length() > 160) {      smstext = smstext.substring(0, 160);      SMS.showText("\nWarning: SMS shorten to 160 characters\n");    } // if    SMS.showText("Dialing Number: " + dialno + "\n");    SMS.showText("Message:        " + smstext + "\n\n");    //----- build PDU    SMSTools smstools = new SMSTools();    byte[] pdu = SMSTools.getPDUPart(dialno, notype, smstext);    //----- send    try {      Port.writeln("AT+CMGF=0");              // set message format to PDU mode      Port.read();      Port.writeln("AT+CMGS=" + pdu.length);  // set length of PDU      Port.read();      Port.write("00");                       // prepare for the PDU      Port.write(SMSTools.toHexString(pdu));  // set PDU      Port.write("\u001A");                   // set Ctrl-Z = indicates end of PDU      Port.read();    } // try    catch (Exception e) {      SMS.showText("Error: send SMS failed: " + e);    } // catch  }  // sendSMS  /** get SMS from the ME   *  @param  index of SMS   *  @return  SMS string of the ME   *  @throws Exception   */  public static String getSMS(int index) throws Exception {    int p;    String s="";    try {      s = Port.sendAT ("AT+CMGR=" + index);    } // try    catch (Exception e) {      SMS.showText("Error: getSMS failed: " + e);    } // catch    //----- destilate the PDU from the received string of raw data    p = s.indexOf("+CMGR:");    // delete the AT command information at the beginning of the PDU    s = s.substring(p+6, s.length());    p = s.indexOf("\n");    s = s.substring(p+1, s.length());    p = s.indexOf("\r");        // delete LF / CR at the end of the PDU    s = s.substring(0, p);    return s;  } // getSMS  /** get number of stored SMS from the ME   *  @return  number of stored SMS in the ME   *  @throws Exception   */  public static int getNoOfSMS() throws Exception {    int n=-1;    int[] index;    try {      index = getIndexOfSMS();          // get a index list of stored SMS      do {                              // search all guilty index of SMS        n++;      } while (index[n] != 0);    }  // try    catch (Exception e) {      SMS.showText("Error: getNoOfSMS failed: " + e);    }  // catch    return n;  } // getNoOfSMS  /** get an index list of guilty SMS from the ME   *  @return  list of indexes of stored SMS in the ME   *  @throws Exception   */  public static int[] getIndexOfSMS() throws Exception {    int n, p;    int[] index;    index = new int[SMS.MAXNOSIMSMS];    String s = "", atrsp = "";    try {      atrsp = Port.sendAT ("AT+CMGL");    } // try    catch (Exception e) {      SMS.showText("Error: getIndexOfSMS failed: " + e);    } // catch    // get a index list from the stored SMS    // example of answer: "+CMGL: 1,0,,51", 1 is the index of the SMS    n = 0;    do {      p = atrsp.indexOf("+CMGL: ");      if (p != -1) {                             // found a new PDU        atrsp = atrsp.substring(p+7, atrsp.length());        p = atrsp.indexOf(",");        s = atrsp.substring(0, p);        index[n] = Integer.parseInt(s.trim());      } // if      else break;      n++;    } while (p != -1);    return index;  } // getIndexOfSMS  /** delete a SMS from the ME   *  @param  index of SMS   *  @throws Exception   */  public static void deleteSMS(int index) throws Exception {    String s="";    try {      s = Port.sendAT ("AT+CMGD=" + index);    } // try    catch (Exception e) {      SMS.showText("Error: deleteSMS failed: " + e);    } // catch  } // deleteSMS  /** deletes all SMS from the ME   *  @throws Exception   */  public static void deleteAllSMS() throws Exception {    int n;    int[] index;    try {      index = getIndexOfSMS();          // get a index list of stored SMS      n = -1;      do {        n++;        if (index[n] != 0) {          // found a guilty index for a SMS          SMS.showText("Delete SMS with Index: " + index[n] + "\n");          deleteSMS(index[n]);        } // if      } while (index[n] != 0);    }  // try    catch (Exception e) {      SMS.showText("Error: deleteAllSMS failed: " + e);    }  // catch  } // deleteAllSMS  /** get the signal quality from the ME   *  @return  received signal strength indication (rssi = 0 ... 31 (best), 99 not known)   *  @throws Exception   */  public static int getSignalQuality() throws Exception {    int n, p;    String s = "";    try {      s = Port.sendAT ("AT+CSQ");    } // try    catch (Exception e) {      SMS.showText("Error: getSignalQuality failed: " + e);    } // catch    // destilate the signal quality from the answer string    // example of answer: "+CSQ: 31,99"    if (s.length() > 0) {      p = s.indexOf(":");      s = s.substring(p+1, s.length());      p = s.indexOf(",");      s = s.substring(0, p);      n = Integer.parseInt(s.trim());    } // if    else n = 99;    return n;  } // getSignalQuality  /** get the battery status from the ME   *  @return  battery connection status (bcs), battery charge level (bcl)   *           bcs: 0	     powered by the battery   *                1	     battery connected, but not powered by it   *                2	     does not have a battery connected   *           bcl: 0	     battery is exhausted, or MT does not have a battery connected   *                1...100  battery has 1 ... 100 percent of capacity remaining   *  @throws Exception   */  public static String getBatteryStatus() throws Exception {    int p;    String s = "";    try {      s = Port.sendAT ("AT+CBC");    } // try    catch (Exception e) {      SMS.showText("Error: getBatteryStatus failed: " + e);    } // catch    // destilate the battery status from the answer string    // example of answer: "+CBC: 0,90"    if (s.length() > 0) {      p = s.indexOf(":");      s = s.substring(p+1, s.length());      p = s.indexOf("\r");      s = s.substring(0, p);      s = s.trim();    } // if    else s = "";    return s;  } // getBatteryStatus  /** test the connection between PC and ME   * @return  answer string of the ME   * @throws java.rmi.RemoteException   */  public static boolean test() throws java.rmi.RemoteException {    String s="";    try {      Port.writeln("AT");   // test if there is a working communication      s = Port.read();      // get response from ME    } // try    catch (Exception e) {      SMS.showText("Error: testConnection failed:" + e);    } // catch    if (s.indexOf("AT") == 0) return true;  // working connection to the mobile phone    else return false;                      // no connection to the mobile phone  }  // test} // Msg

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩二区在线观看| 国产不卡在线视频| 激情综合网最新| 91丨porny丨首页| 2023国产精华国产精品| 伊人夜夜躁av伊人久久| 国产乱人伦精品一区二区在线观看| 91色婷婷久久久久合中文| 久久综合久久久久88| 亚洲国产乱码最新视频| 99精品国产99久久久久久白柏| xfplay精品久久| 免费精品视频在线| 日本韩国一区二区三区视频| 日本一区免费视频| 极品少妇xxxx精品少妇偷拍| 欧美人狂配大交3d怪物一区| 夜夜夜精品看看| 床上的激情91.| 久久久久久久久一| 喷水一区二区三区| 欧美三级三级三级| 亚洲国产精品久久人人爱蜜臀| 成人sese在线| 亚洲国产成人私人影院tom| 国产在线视视频有精品| 欧美mv日韩mv亚洲| 极品美女销魂一区二区三区| 日韩欧美专区在线| 美女一区二区视频| 日韩欧美一级精品久久| 青青草精品视频| 日韩一区二区三区四区| 人妖欧美一区二区| 日韩一区二区免费高清| 五月综合激情网| 日韩视频免费直播| 美美哒免费高清在线观看视频一区二区| 91精品久久久久久久久99蜜臂| 午夜影院在线观看欧美| 欧美日韩国产另类不卡| 免费观看成人av| 精品国产人成亚洲区| 美女网站色91| 欧美激情中文不卡| 一本一道久久a久久精品综合蜜臀| 日韩美女啊v在线免费观看| 色88888久久久久久影院按摩| 一区二区三区中文字幕电影| 欧美在线观看视频一区二区 | 日本一区二区三区电影| 懂色av一区二区在线播放| 国产精品国产自产拍高清av王其| 色天天综合久久久久综合片| 日韩电影在线一区| 国产午夜亚洲精品午夜鲁丝片| 成人app在线观看| 一区2区3区在线看| 日韩欧美123| 99久久综合国产精品| 亚洲第一二三四区| 日韩免费在线观看| 丁香天五香天堂综合| 亚洲美女电影在线| 日韩午夜在线观看| 99国产精品一区| 男女性色大片免费观看一区二区| 欧美电影免费观看高清完整版在| 成人一区二区三区中文字幕| 亚洲福利国产精品| 久久精品视频在线看| 欧美在线制服丝袜| 国产一区欧美一区| 亚洲一区二区在线播放相泽| 久久久综合视频| 欧美精品一二三四| 白白色 亚洲乱淫| 免播放器亚洲一区| 亚洲欧美激情视频在线观看一区二区三区 | 日韩欧美成人一区| 97国产一区二区| 久久99精品久久久久久国产越南| 亚洲女爱视频在线| 久久毛片高清国产| 欧美精品久久天天躁| 97成人超碰视| 国产一区二区剧情av在线| 午夜欧美在线一二页| 日本一区二区三区久久久久久久久不| 欧美日本在线播放| 一本色道久久综合亚洲aⅴ蜜桃| 久久99国产精品尤物| 亚洲福利一二三区| 国产精品国产三级国产aⅴ中文| 精品国产成人在线影院| 欧美电影一区二区| 一本到三区不卡视频| 懂色av中文一区二区三区| 狠狠色丁香九九婷婷综合五月| 午夜激情综合网| 亚洲综合成人在线| 亚洲精品国产第一综合99久久| 亚洲国产精品99久久久久久久久| 久久亚洲捆绑美女| 欧美tickling挠脚心丨vk| 欧美一区二区成人| 欧美日韩在线播| 欧美偷拍一区二区| 色欧美88888久久久久久影院| 91丝袜国产在线播放| 成人高清在线视频| av激情亚洲男人天堂| 成人免费观看视频| 国产91精品精华液一区二区三区 | 亚洲1区2区3区视频| 亚洲精品久久久久久国产精华液| 国产精品传媒入口麻豆| 国产精品不卡视频| 国产精品萝li| 亚洲欧美日韩国产一区二区三区 | 欧美日韩综合在线免费观看| 欧美一a一片一级一片| 在线日韩av片| 欧美日韩另类一区| 日韩一级片在线观看| 欧美大片在线观看| 国产三级精品视频| 亚洲日本va在线观看| 亚洲欧美日本在线| 亚洲成人自拍一区| 久久成人免费日本黄色| 国产一区二区三区香蕉 | 久久超碰97中文字幕| 国产在线精品免费av| 丁香婷婷综合色啪| 91久久精品网| 欧美不卡一区二区三区| 国产日韩欧美精品在线| 亚洲三级久久久| 午夜久久电影网| 久久超级碰视频| thepron国产精品| 欧美日韩一级黄| 精品少妇一区二区三区在线播放| 久久久www成人免费无遮挡大片| 最新国产の精品合集bt伙计| 亚洲成人动漫精品| 国产传媒日韩欧美成人| 一本大道久久精品懂色aⅴ| 欧美精品色综合| 国产女人18水真多18精品一级做| 亚洲欧美区自拍先锋| 老司机午夜精品| 91麻豆自制传媒国产之光| 日韩欧美自拍偷拍| 亚洲女同ⅹxx女同tv| 久久97超碰色| 在线观看欧美精品| 久久网站最新地址| 亚洲一区在线观看免费| 国产精品资源网| 3d动漫精品啪啪1区2区免费| 中文字幕av一区二区三区高| 亚洲成人自拍网| 91蜜桃婷婷狠狠久久综合9色| 日韩欧美国产综合| 亚洲麻豆国产自偷在线| 国产精品夜夜爽| 欧美狂野另类xxxxoooo| 国产精品卡一卡二卡三| 免费观看日韩av| 欧美日韩国产精品自在自线| 国产精品美女久久久久久久久| 麻豆91在线播放免费| 欧美亚洲自拍偷拍| 中文字幕制服丝袜成人av| 国产一区高清在线| 91麻豆精品国产综合久久久久久| 亚洲色图一区二区三区| 国产福利一区二区三区| 欧美成人a视频| 亚州成人在线电影| 91国在线观看| 亚洲国产高清在线观看视频| 国产一区二区按摩在线观看| 91麻豆精品国产91久久久久久 | 奇米一区二区三区av| 欧美三级在线视频| 亚洲精品成a人| av在线一区二区| 国产精品二三区| 波波电影院一区二区三区| 久久久久国产精品厨房| 韩国女主播成人在线| 精品女同一区二区| 久久国产婷婷国产香蕉| 欧美va日韩va| 精品无码三级在线观看视频| 日韩欧美精品在线| 韩国v欧美v日本v亚洲v|