Re: MoveTo() and file overwritting

  •  01-07-2009, 1:38 PM

    Re: MoveTo() and file overwritting

    Hi,
     
    You can delete the file if it exists:
     
    if(System.IO.File.Exists(filepath))
        System.IO.File.Delete(filepath);
    args.MoveTo(filepath);
     
    or you can report error if you do not want to override it:
     
    if(System.IO.File.Exists(filepath))
    {
        SendAlert("File already exists");
        return;
    }
    args.MoveTo(filepath);
     
    Regards,
    Terry
View Complete Thread