1-1-15-4 菜鸟级问题,请教高手!!
发信人: astley (kevin), 信区: Java标题: Re: 菜鸟级问题,请教高手!!
发信站: BBS 水木清华站 (Mon Jul 15 11:33:06 2002)
String gethost(String args)
{
try
{
url=new URL(args);
urlhost=url.getHost();
}catch(MalformedURLException e)
{
System.out.println("Error ocurr!");
}
return urlhost;
}
【
在 andyzx (阴天无雨) 的大作中提到: 】
: 我编了个查主机的程序,但总有个错误不能排除,希望得到指教
: import java.net.URL;
: import java.net.MalformedURLException;
: public class Gothost{
: URL url;
: String urlhost;
: String gethost(String[] args){
: try {
: urlhost=url.getHost();
: }catch(MalformedURLException e)
: {
: ...................
页:
[1]