Sometimes we have to write the same data from one file into another file.So we waste a lot of time in it.In Dynamics Ax having special way to do that through WINAPI class.Here am showing you how to copy the files and delete the old files...... before we doing this we add File IO permission for file name with Read/Write permissions.....
Formats:
WINAPI::CopyFile("SourceFilePathName","DestinationFilePathName",BooleanValues);
WINAPI::DeleteFile("SourceFilePathName");
(or)
System.IO.File::Copy("SourceFilePathName","DestinationFilePathName",BooleanValues);
System.IO.File::Delete("SourceFilePathName");
Example;
static void wpicopy(Args _args)
{
;
winApi::copyFile(@"E:\AxDynamics\car.txt",@"E:\AxDynamics\carIdValues.txt",true);
winApi::deleteFile(@"E:\AxDynamics\car.txt");
}
It will Supporting to Copy the All File Types like an Excel,Txt,Xml......
No comments:
Post a Comment