yamuna Posted October 31, 2008 Report Share Posted October 31, 2008 Hi All, As I am working on the desktop application.while copying one dll into another folder i am getting the exception like : "Could not find a part of the path :"\\windows\mscce35.dll" " My code follows as: string sFile = "CEPLAN.CPN"; string sSourcePath = getAppPath() + @"ToCopy\DeviceRoot\" + sFile; string sTargetPath = @"\" + sFile; if (!File.Exists(sTargetPath)) // Check remote file does not exist { if (File.Exists(sSourcePath)) // Check local file exists before copy { File.Copy(sSourcePath, sTargetPath); } } // Copy to windows folder sSourcePath = getAppPath() + @"ToCopy\Windows"; sTargetPath = @"\Windows"; foreach (string sSourceFilePath in Directory.GetFiles(sSourcePath)) { string sTargetFilePath = sTargetPath + @"\" + Path.GetFileName(sSourceFilePath); if (!File.Exists(sTargetFilePath)) // Check remote file does not exist { if (File.Exists(sSourceFilePath)) // Check local file exists before copy { File.Copy(sSourceFilePath, sTargetFilePath); //after coming to here i am getting the given exception } } } Can any one help me,what i am missing or did any mistake ? Reply me ASAP,if possible. Thanks in Advance. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.