萍聚社区-德国热线-德国实用信息网

 找回密码
 注册

微信登录

微信扫一扫,快速登录

萍聚头条

查看: 589|回复: 0

1-1-15-4 菜鸟级问题,请教高手!!

[复制链接]
发表于 2003-2-7 01:18 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?注册 微信登录

x
发信人: astley (kevin), 信区: Java      
标  题: Re: 菜鸟级问题,请教高手!!
发信站: BBS 水木清华站 (Mon Jul 15 11:33:06 2002)


  1. String gethost(String args)
  2.      {
  3.              try
  4.              {
  5.                 url=new URL(args);
  6.                 urlhost=url.getHost();
  7.          }  catch(MalformedURLException e)
  8.              {
  9.                 System.out.println("Error ocurr!");
  10.              }
  11.           return urlhost;
  12.         
  13.           }


  14. 在 andyzx (阴天无雨) 的大作中提到: 】
  15. : 我编了个查主机的程序,但总有个错误不能排除,希望得到指教
  16. : import java.net.URL;
  17. : import java.net.MalformedURLException;
  18. : public class Gothost{
  19. :      URL url;
  20. :      String urlhost;
  21. :      String gethost(String[] args){
  22. :       try {
  23. :            urlhost=url.getHost();
  24. :              }  catch(MalformedURLException e)
  25. :              {
  26. : ...................
复制代码
Die von den Nutzern eingestellten Information und Meinungen sind nicht eigene Informationen und Meinungen der DOLC GmbH.
您需要登录后才可以回帖 登录 | 注册 微信登录

本版积分规则

手机版|Archiver|AGB|Impressum|Datenschutzerklärung|萍聚社区-德国热线-德国实用信息网

GMT+1, 2025-2-7 12:57 , Processed in 0.064389 second(s), 17 queries , MemCached On.

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表