Create Directory-
string diretorypath= Application.StartupPath;
string ImagePath = diretorypath+ "\\" + "Images_" + DateTime.Now.ToString("ddMMyyyy") + "_" + DateTime.Now.ToString("hhmmss");
if(!Directory.Exists(Sfilepthe))//create directory
Directory.CreateDirectory(ImagePath);
//Copy files
public void CopyFiles(string sourcePath, string destinationPath, string sFileName)
{
try
{
string Sfilepthe = sourcePath + "\\" + sFileName;
string Sdestination = destinationPath + "\\" + sFileName;
if (File.Exists(Sfilepthe))
{
File.Copy(Sfilepthe, Sdestination, true);
}
}
catch (Exception ex)
{ }
}
string diretorypath= Application.StartupPath;
string ImagePath = diretorypath+ "\\" + "Images_" + DateTime.Now.ToString("ddMMyyyy") + "_" + DateTime.Now.ToString("hhmmss");
if(!Directory.Exists(Sfilepthe))//create directory
Directory.CreateDirectory(ImagePath);
//Copy files
public void CopyFiles(string sourcePath, string destinationPath, string sFileName)
{
try
{
string Sfilepthe = sourcePath + "\\" + sFileName;
string Sdestination = destinationPath + "\\" + sFileName;
if (File.Exists(Sfilepthe))
{
File.Copy(Sfilepthe, Sdestination, true);
}
}
catch (Exception ex)
{ }
}
No comments:
Post a Comment