Article View: cn.bbs.comp.lang.java
Article #21272Re: ��������IJ����������
From: javaphp
Date: Wed, 10 Dec 2003 08:20
Date: Wed, 10 Dec 2003 08:20
29 lines
1889 bytes
1889 bytes
��һ�������
public boolean renameFile(String srcName,String destName){
try{
File srcFile=new File(srcName);
File parent = srcFile.getParentFile();
File dest=new File(parent, destName);
return srcFile.renameTo(dest);
}catch(Exception e){
e.printStackTrace();
return false;
}
}
--
�ս����һ��վ�㣬������ͬ��Ȥ�����Ѽ��ˣ�
http://www.javaphp.com/
--
���ѡ�havy���ڡ�����ļ�����IJ���������ڡ�һ����д��:
> public boolean renameFile(String srcName,String destName){
> try{
> File srcFile=new File(srcName);
> File dest=new File(destName);
> return srcFile.renameTo(dest);
> }catch(Exception e){
> e.printStackTrace();
> return false;
> }
> }
Technical Details
Message-ID:
<3nldtvchnsb2rmnnji8gkpvnnpdmvbc6uq@4ax.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed.media.kyoto-u.ac.jp!news.cn99.com!news.yaako.com!not-for-mailReferences:
<49aUPj$9WM@bbs.sjtu.edu.cn>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,GB X-Google-Thread: f6cb0,25ce40b4bced5d7b X-Google-Attributes: gidf6cb0,public X-Google-ArrivalTime: 2003-12-10 00:20:31 PST Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed.media.kyoto-u.ac.jp!news.cn99.com!news.yaako.com!not-for-mail From: javaphp <javaphp@sohu.com> Newsgroups: cn.bbs.comp.lang.java Subject: Re: ��������IJ���������� Date: Wed, 10 Dec 2003 16:20:45 +0800 Organization: Bentium Ltd. (CN99) Lines: 30 Message-ID: <3nldtvchnsb2rmnnji8gkpvnnpdmvbc6uq@4ax.com> References: <49aUPj$9WM@bbs.sjtu.edu.cn> Reply-To: javaphp@sohu.com NNTP-Posting-Host: 211.157.16.205 Mime-Version: 1.0 Content-Type: text/plain; charset=GB2312 Content-Transfer-Encoding: 8bit X-Trace: news.yaako.com 1071044366 13197 211.157.16.205 (10 Dec 2003 08:19:26 GMT) X-Complaints-To: usenet@news.yaako.com NNTP-Posting-Date: Wed, 10 Dec 2003 08:19:26 +0000 (UTC) X-Newsreader: Forte Agent 1.8/32.548