-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMain.cs
More file actions
50 lines (46 loc) · 1.47 KB
/
Main.cs
File metadata and controls
50 lines (46 loc) · 1.47 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Windows.Forms.VisualStyles;
using System.IO;
namespace DataBaseLab1_2
{
public partial class Main : Form
{
public Main()
{
InitializeComponent();
}
private void btnCreateDB_Click(object sender, EventArgs e)
{
CreateDB createDB = new CreateDB();
createDB.ShowDialog();
CreateSavesDir(createDB.newDBName.Text);
}
private void CreateSavesDir(string baseName)
{
DirectoryInfo dir = new DirectoryInfo("..\\..\\Bases\\"+ baseName);
dir.CreateSubdirectory("Saves");
dir = new DirectoryInfo(dir.FullName + "\\Saves");
dir.CreateSubdirectory("Save");
using (File.Create(dir.FullName + "\\LastSave.txt")) { };
File.WriteAllText(dir.FullName + "\\LastSave.txt", dir.FullName + "\\Save");
}
private void btnOpenDB_Click(object sender, EventArgs e)
{
System.Diagnostics.Process.Start(@"..\..\Bases\");
OpenDB openDB = new OpenDB(this);
openDB.ShowDialog();
if (openDB.textDBName.Text == string.Empty) { return; }
DMS dms = new DMS();
dms.ShowDialog();
//this.Hide();
}
}
}