且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何重命名文件...

更新时间:2023-12-05 20:44:34

使用 ^ ]方法.


Yes as per the OriginalGriff wrote, if you want to rename the file then, you have to use Move() method which is static method of File class. This class is available in System.IO namespace... <br />
syntax :<br />
<pre>File.Move(oldFileName, newFileName);</pre><br />
or you can use copy and delete command like....<br />
<pre lang="midl">File.Copy(oldFileName, NewFileName);<br />
<br />
File.Delete(oldFileName);</pre><br />
for more details on how to rename file see <a href="http://msdn.microsoft.com/en-us/library/system.io.file(v=vs.71).aspx">this</a>[<a href="http://msdn.microsoft.com/en-us/library/system.io.file(v=vs.71).aspx" target="_blank" title="New Window">^</a>] link...<br />


希望对您有所帮助...

链接 [
I Hope this may Help you...

Link[^]