?? websearch.java
字號:
/*
* Created on 2005-8-18
*
* To change the template for this generated file go to
* Window>Preferences>Java>Code Generation>Code and Comments
*/
package com.ahbay.mailMgr;
import java.io.*;
import java.net.*;
/**
* @author: 王仁超
* @Date: 2005-8-18
* @FileName: webSearch.java
* @PackageName: com.ahbay.mailMgr
* @Method Name:
*/
public class webSearch {
public String StartSearch(String strUrl)
{
try
{
InputStream l_urlStream;
URL l_url = new URL(strUrl);
HttpURLConnection l_connection = (HttpURLConnection) l_url.openConnection();
l_connection.connect();
l_urlStream = l_connection.getInputStream();
BufferedReader l_reader = new BufferedReader(new InputStreamReader(l_urlStream));
String sCurrentLine;
String line;
String path="C:\\Tomcat 5.0\\webapps\\WebManager\\web_it\\searchResult.htm";
File f=new File(path);
if(f.exists()) f.delete();
FileWriter news=new FileWriter(path);
while ((sCurrentLine = l_reader.readLine()) != null)
{
try
{
news.write(sCurrentLine);
news.write("\n");
}
catch (IOException e)
{
return e.getMessage();
}
}
news.close();
}
catch(Exception e)
{
return e.getMessage();
}
return "1";
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -