⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 sendotabrowsersettings.java~1~

📁 控制手机发送短信程序
💻 JAVA~1~
字号:
import java.io.File;import java.io.IOException;import com.objectxp.msg.GsmSmsService;import com.objectxp.msg.MessageException;import com.objectxp.msg.SmsService;import com.objectxp.msg.ota.Bookmark;import com.objectxp.msg.ota.GPRSBrowserSettings;/** * This example demonstrates how to send GPRS BrowserSettings appended * by a bookmark. */public class SendOtaBrowserSettings {  public static void main(String[] args) throws IOException, MessageException   {    if(args.length != 2 ) {      System.err.println("Usage: SendSMS <config-file> <recipient>");      System.exit(1);    }        // Create and initialize the SmsService (Replace GsmSmsService with    // the SmsService Implementation of your choice).    SmsService service = new GsmSmsService();    service.init(new File(args[0]));    // create BrowserSettings    GPRSBrowserSettings settings = new GPRSBrowserSettings("123.45.6.7");    settings.setGPRSAccesspointName("grps-ap");    settings.setName("objectXP");    settings.setPPPAuthtype(GPRSBrowserSettings.PAP);    settings.setPort(9200);     settings.setPPPLogin("mylogin", "mypasswd");    settings.setPPPAutoLogin(true);    settings.addBookmark(new Bookmark("objectXP", "www.objectxp.com"));    settings.setRecipient(args[1]);            try {      service.connect();      service.sendMessage(settings);      service.disconnect();    } finally {      service.destroy();     }  }}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -