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 ?
Could not find a part of the path :"\\windows\mscce35.dll" In desktop application
in Windows Forms
Posted
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.