I have a strange problem. I have this code:
private void button1_Click(object sender, EventArgs e)
{
string[] filePaths = Directory.GetFiles(@"C:\Users\Shorko\Desktop\mobile-store", "*.rar",
SearchOption.AllDirectories);
for (int i = 0; i < filePaths.Length; i++)
{
string path = "E://yo";
File.Move(filePaths[i], path);
}
}
I also created the app.manifest file and changed one of the lines to:
<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
But I’m still getting the same error! I know there are tons of posts like this,but I can’t get it working.
File.Move requires two filenames, a source filename and a destination file name.
Doesn’t work if the destination is a directory.