0

I am trying to move Txt files from one folder to another but I keep getting an error message stating "illegal characters in path". I think it's because of the * in the file name but how do i change it to except it?


string sourceFile = @"C:\\new1\*.txt";
string destinationFile = @"C:\\new2\*.txt";

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

try putting this....

string sourceFile = @"C:\\new1\\*.txt";
string destinationFile = @"C:\\new2\\*.txt";

0

Thanks Mono,

I have already tried this but haven't had any luck. It's not liking the "*" symbol but not sure what I can change it for or define in the code...

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.