<add key ="sourcepath" value="D:\Temp\Test" /> <add key ="destPath" value="D:\Default\Test\Sample"/>
// strFileName is the FileName to be Moved to destination Folder private void FileMove(string strFileName){ //Retriving sourcepath and Destination path from Config file string strSourcePath = ConfigurationManager.AppSettings["sourcepath"]; string strdestPath = ConfigurationManager.AppSettings["destPath"]; if (!Directory.Exists(strdestPath )) // Checks for existness of destination directory Directory.CreateDirectory(strdestPath); // if doesn't exists it creates dest'n directory string strSourceFileName = strSourcePath+strFileName string strDestFileName = strdestPath + strFileName ; File.Move(strSourceFileName, strDestFileName); // Moves the file to Destination folder Label1.Text = "File Moved Successfully";}