FileInfo.MoveTo(String path) : FileInfo « System.IO « C# / C Sharp by API






FileInfo.MoveTo(String path)

   

using System;
using System.IO;

public class MainClass
{
  static void Main(string[] args)
  {
    FileInfo MyFile = new FileInfo(@"c:\Testing.txt");

    MyFile.Create();
    MyFile.MoveTo(@"c:\MyFolder\Moved Testing.txt");
    MyFile.MoveTo(@"C:\MyFolderNew");
  }
}

   
    
    
  








Related examples in the same category

1.new FileInfo(String fileName)
2.FileInfo.Attributes
3.FileInfo.Create()
4.FileInfo.CreationTime
5.FileInfo.CopyTo(String fileName)
6.FileInfo.Delete
7.FileInfo.Directory
8.FileInfo.FullName
9.FileInfo.LastAccessTime
10.FileInfo.Open
11.FileInfo.OpenRead
12.FileInfo.OpenText
13.FileInfo.OpenWrite()