.Net에서 지정한 폴더가 있는 지확인하고 파일 복사하는 루틴샘플
string path = System.Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\xxxx\\yyyyy";
if (!Directory.Exists(path))
{
Directory.CreateDirectory(path);
}
string guestName = "Guest.dat";
string localDB = "LocalPhoneBook.dat";
string srcPath = "";
if (!File.Exists(path + "\\" + guestName))
{
srcPath = "./" + guestName;
File.Copy(srcPath, path + "\\" + guestName);
}
if (!File.Exists(path + "\\" + localDB))
{
srcPath = "./" + localDB;
File.Copy(srcPath, path + "\\" + localDB);
}
이 글은 스프링노트에서 작성되었습니다.