- using System;
- using System.IO;
- namespace Client.Chapter_11___File_and_Streams
- {
- public class MovingAFiles {
- static void Main(string[] args)
- {
- FileInfo MyFile = new FileInfo(@"c:\\Projects\\Testing.txt");
- MyFile.Create();
- MyFile.MoveTo(@"c:\\\\Projects\\MyFolder\\Moved Testing.txt");
- MyFile.MoveTo(@"C:|projects\\MyFolder");
- }
- }
- }
- //该片段来自于http://www.codesnippet.cn/detail/2010201410699.html
来源: http://www.codesnippet.cn/detail/2010201410699.html