Question copy file problem.the following code have problem

aris89

New member
Joined
Mar 29, 2021
Messages
1
Programming Experience
1-3
C#:
string source = @"C:\Users\a.konidaris\Desktop\Project new\new.pdf";
string destination = @"C:\Euronovate\ENMonitor\DocFolder\input";
System.IO.File.Move(source, destination);
File.Copy(source,destination,true);
Console.WriteLine("File copied");
 
Last edited by a moderator:
Your question needs a lot of work. Firstly, don't post unformatted code snippets. They are hard to read. Secondly, your post contains no explanation at all. Thirdly, your title mentions a problem but you never describe it.

Start by providing a FULL and CLEAR explanation of the problem in your post. That MUST include an explanation of what you're trying to achieve, how you're trying to achieve it (including relevant code) and what happens when you try (including relevant error messages and where they occur, as well as any other unexpected behaviour). Once you have provided all the relevant information in the post, write a brief title that summarises the issue.

As for the code, why do you think moving a file first, then trying to copy it from the location you just moved it from would be a good idea?
 
The OP's question feels like a C# interview screening question used to weed out some job applicants early.
 
The OP's question feels like a C# interview screening question used to weed out some job applicants early.
I hadn't considered that but it seems plausible.
 
Back
Top Bottom