I am using this code and I was wondering if I can set the @"ConsoleApplication2.exe", where the "ConsoleApplication2.exe" part can be a variable. Which I mean instead of specifying the filename, there is a variable instead for the file's current name. I hope you guys will understand what I am asking.Code:System.IO.File.Move(@"ConsoleApplication2.exe", @"C:\CA\ConsoleApplication2.exe");
Example:
%var = file's current name
Say my file's name is TODD.exe so %var = Todd.exe
Code:System.IO.File.Move(@"%var", @"C:\CA\%var");




Reply With Quote