📄 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 + -