v0.02
This commit is contained in:
parent
859b2839a4
commit
aebdc68bce
1
AsmrManage/AsmrManage/Form1.Designer.cs
generated
1
AsmrManage/AsmrManage/Form1.Designer.cs
generated
@ -342,6 +342,7 @@
|
||||
button6.TabIndex = 6;
|
||||
button6.Text = "打开文件";
|
||||
button6.UseVisualStyleBackColor = true;
|
||||
button6.Click += button6_Click;
|
||||
//
|
||||
// button5
|
||||
//
|
||||
|
@ -270,5 +270,34 @@ namespace AsmrManage
|
||||
textBox5.Text = openFileDialog1.FileName;
|
||||
}
|
||||
}
|
||||
|
||||
private void button6_Click(object sender, EventArgs e)
|
||||
{
|
||||
if(Program.config == null) { Program.config = ConfigManager.LoadConfig(); }
|
||||
string db_path = Program.config.DatabaseFilePath;
|
||||
string dbb_path = Program.config.DBBrowserPath;
|
||||
//检查路径是否存在
|
||||
if (File.Exists(db_path) && File.Exists(dbb_path))
|
||||
{
|
||||
ProcessStartInfo psi = new ProcessStartInfo
|
||||
{
|
||||
FileName = dbb_path,
|
||||
Arguments = db_path
|
||||
};
|
||||
|
||||
try
|
||||
{
|
||||
Process.Start(psi);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show("发生错误:" + ex.Message, "错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
MessageBox.Show("指定路径不存在。请检查路径是否正确。", "错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -11,6 +11,10 @@ namespace AsmrManage
|
||||
{
|
||||
// To customize application configuration such as set high DPI settings or default font,
|
||||
// see https://aka.ms/applicationconfiguration.
|
||||
if (!File.Exists(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "config.json")))
|
||||
{
|
||||
ConfigManager.SaveConfig(new AppConfig());
|
||||
}
|
||||
config = ConfigManager.LoadConfig(); //fetch configuration data
|
||||
ApplicationConfiguration.Initialize();
|
||||
Application.Run(new Form1());
|
||||
|
Reference in New Issue
Block a user