enterww.java~12~

来自「java彩信网关程序」· JAVA~12~ 代码 · 共 55 行

JAVA~12~
55
字号
package mmscenter;import java.net.*;import java.io.*;public class EnterWW {  public EnterWW() {  }  public static String GoTo(String UrlString){    String result = "";    UrlString = "http://10.10.1.216:8080/mms/sendmms.jsp";    int data;//从输入流中获取数据    try{    URL url=new URL(UrlString);//创建连接的地址    HttpURLConnection  connection=(HttpURLConnection)url.openConnection();//打开连接//    int responseCode=connection.getResponseCode();//    String reponseStr = connection.getResponseMessage();    byte[] bytes = new byte[1024];//    System.out.println(reponseStr);    //返回Http的响应状态码    InputStream input=connection.getInputStream();    //获取输入流//    System.out.println("responseCode:"+responseCode);    while((data=input.read(bytes,0,1024))!=-1){      //System.out.println((new String(bytes,"GBK")));      String line =new String(bytes,"GBK");      result += line;      //int i = line.indexOf("搜狐首页");      //System.out.println(line.substring(i,i+5));//      if(i != -1){//        System.out.println(i+"****************************");//        break;//      }    }    }catch(Exception e){     e.printStackTrace() ;    }    return result;  }  public static String GetResultCode(String str){    String result = "";    if(str.indexOf("<RET>0</RET>")>=0){      result = "0";    }    return result ;  }  public static void main(String[] args) {    EnterWW enterWW1 = new EnterWW();    System.out.println(enterWW1.GoTo("dd"));  }}

⌨️ 快捷键说明

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