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?
Firstly using the @ infront of a string will mean that the \\ is illegal.
Secondly, AFAIK none of the .Net file handling classes support wildcard characters in filenames so the * is also illegal.
Use Directory.GetFiles to get a String array of filenames. Then perform the move on each in turn using a for loop.
All file systems supported by Windows using the concept of files and directories to access data stored on a disk or device. Windows developers to work with the Windows API for file and device I / O must understand the various rules, conventions and limitations of file names and directories.