private bool CopyPhoto(string photoPath, string photoNewName)
{
// 获得 保存照片文件夹路径
//Application.ExecutablePath
string photosDir = AppDomain.CurrentDomain.BaseDirectory + "EmployeesPhotos";
Directory.CreateDirectory(photosDir);
//保存文件路径
string newPath = photosDir + "\\" + photoNewName + Path.GetExtension(photoPath);
File.Copy(photoPath, newPath, true);
return true;
} |