0

Hello,

I am trying to send files from one folder on the C drive to another using a simple C# Win forms. I have created this but unable to get it working. Can anyone help?

private void butSort1_Click(object sender, EventArgs e)
        {
            string sourceFile = @"C:\Test\test.txt";
            string destinationFile = @"C:\Test1\test.txt";

            try
            {
                System.IO.File.Move(sourceFile, destinationFile);
            }
            catch (Exception except)
            {
                lblErrors.Text = except.Message;
            }
        }

Edited by Nick Evan: Added code-tags

3
Contributors
4
Replies
5
Views
7 Years
Discussion Span
Last Post by Mattisc
0

Sorted it. Debugger was playing up so the code is fine. Cheers.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.