TransFileToSpecifiedFolder.cs This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters Show hidden characters ///

/// Transfer file from one Folder to other /// /// Path to Target Folder /// Full Path to Source File public void TransFileToSpecifiedFolder ( string path , string FileName ) { //Deleting file from destination folder if it exists, else exception occurs string path2 = path + " \ " + Path . GetFileName ( FileName ) ; try { LogManager . EventLog ( "Inside TransFileToSpecifiedFolder: Moving '" + Path . GetFileName ( FileName ) + "' to '" + path + "'" ) ; if ( ! Directory . Exists ( path ) ) { Directory . CreateDirectory ( path ) ; } if ( File . Exists ( path2 ) ) File . Delete ( path2 ) ; File . Move ( FileName , path2 ) ; } catch ( Exception ex ) { //Log the error to your logger LogManager . EventLog ( "[Error] Inside TransFileToSpecifiedFolder: " + ex . Message ) ; throw ; } }