?? enterww.java~10~
字號:
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)){ } return result ; } public static void main(String[] args) { EnterWW enterWW1 = new EnterWW(); System.out.println(enterWW1.GoTo("dd")); }}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -