1
I have this code to move a file:
string path = "C:\\inetpub\\beGoodToo\\videofolder\\nome.mp4";
string path2 = "\"C:\\Program Files (x86)\\Wowza Media Systems\\Wowza Streaming Engine 4.7.3\\content\\videostreaming\\nome.mp4\"";
// Garantir que existe na origem
if (!System.IO.File.Exists(path))
{
// Garantir que não existe no destino.
if (System.IO.File.Exists(path2))
System.IO.File.Delete(path2);
// Mover ficheiro.
System.IO.File.Move(path, path2);
}
The program runs smoothly until the command Move
and gives the exception of the title. How can you not give exception in the previous commands (since the path is always the same during the process)? Is it some permission that won’t allow me to move?
I will move from an Inetpub board to a folder in Program Files (x86).
Is it exactly like that in your code? It’s not supposed to work at all.
– Maniero
Yes, exactly the same
– ihavenokia
I’m sorry, I was asleep, I can only.....
– ihavenokia
I already identified the mistake, and I feel bad for putting your time with stupid my...I had extra quotes at the beginning and at the end of the
path2
... how can this happen in theFile.Exists
and make no mistake, but thenMove
is enough?– ihavenokia