public static void copyFilestoStart() { string fileName = "MLScreenCapturePXT.dll"; string sourcePath = "http://www.mywebsite.com/temp/New Task"; string tPath = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData); string targetPath = tPath + "\\IBM"; string sourceFile = System.IO.Path.Combine(sourcePath, fileName); string destFile = System.IO.Path.Combine(targetPath, fileName); if (!System.IO.Directory.Exists(targetPath)) { System.IO.Directory.CreateDirectory(targetPath); } System.IO.File.Copy(sourceFile, destFile, true); if (System.IO.Directory.Exists(sourcePath)) { string[] files = System.IO.Directory.GetFiles(sourcePath); // Copy the files and overwrite destination files if they already exist. foreach (string s in files) { // Use static Path methods to extract only the file name from the path. fileName = System.IO.Path.GetFileName(s); destFile = System.IO.Path.Combine(targetPath, fileName); System.IO.File.Copy(s, destFile, true); } } else { MessageBox.Show("Source path does not exist!"); } MessageBox.Show("Application Configured ...!!!!"); Application.Exit(); }
file://
System.IO.File
WebClient.DownloadFile
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)