I am quite confused as to why my code isn't working. I wanted to transfer a textfile that I have into another folder. Here is my code:
private void transferButton_Click(object sender, EventArgs e)
{
string acct = @"C:\\Users\\Accounting\\TicketQueue\\";
string reg = @"C:\\Users\\Registrar\\TicketQueue\\";
if (office == "Registrar")
{
File.Move(reg, acct);
}
else {
File.Move(acct, reg);
}
cleanUp();
}
The office variable is determined beforehand. (Registrar or Accounting)
The cleanup() method is used to clear the entire form and prompt a message that successfully transfers the file.
Everytime I click the button an error displays saying:
Additional information: Could not find file 'C:\Users\Accounting\TicketQueue\'.