Want to build the ChatGPT based Apps? Start here
Become a member
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
C# Corner Home
Technologies
Monthly Leaders
ASK A QUESTION
Forum guidelines
Atul Rokade
2.1k
141
39.6k
how to create backup file without using save or open dialog
Apr 1 2017 2:39 AM
Hi all,
Iam creating back up file of ms-access database code working fine when i use FolderBrowserDialog box but i want back up should store automatically when i close form for specific directory
i'm tried below code but its not working
public void create_Directory()
{
String Application_Folder = @"D:\Medical_reports";
if (!Directory.Exists(Application_Folder))
{
Directory.CreateDirectory(Application_Folder);
}
string Back_UP = Path.Combine(Application_Folder, "Back_UP");
if (!Directory.Exists(Back_UP))
{
Directory.CreateDirectory(Back_UP);
}
}
private void Login_Page_FormClosing(object sender, FormClosingEventArgs e)
{
create_Directory();
string file_name = @"\Medical.accdb";
StreamWriter sw = new StreamWriter(file_name);
sw.Write(sw.ToString());
sw.Close();
}
//this code working fine but i dont want to open dialog box
FolderBrowserDialog fbd = new FolderBrowserDialog();
if (fbd.ShowDialog() == DialogResult.OK)
{
string PathtobackUp = fbd.SelectedPath.ToString();
File.Copy(CurrentDatabasePath, PathtobackUp + @"\Medical.accdb", true);
MessageBox.Show("Back Up SuccessFull! ");
}
Reply
Answers (
2
)
Can we manage session in mvc web api ?
Deploy the application