|
@@ -1506,16 +1506,50 @@ namespace CommonAIEditor
|
|
|
Process p = Process.Start("ResBuilder.exe");
|
|
|
p.WaitForExit();
|
|
|
|
|
|
- string sPath = "";
|
|
|
- FolderBrowserDialog folder = new FolderBrowserDialog();
|
|
|
- folder.Description = "选择文件所在文件夹目录"; //定义在对话框上显示的文本
|
|
|
- if (folder.ShowDialog() == DialogResult.OK)
|
|
|
+ string sPath = null;
|
|
|
+
|
|
|
+ string tmpCfg = "./lastSave.cfg";
|
|
|
+ if (File.Exists(tmpCfg))
|
|
|
{
|
|
|
- sPath = folder.SelectedPath;
|
|
|
+ try
|
|
|
+ {
|
|
|
+ FileStream fs = new FileStream(tmpCfg, FileMode.Open, FileAccess.Read);
|
|
|
+ byte[] bytes = new byte[256];
|
|
|
+ int len = fs.Read(bytes, 0, bytes.Length - 1);
|
|
|
+ if (len > 0)
|
|
|
+ {
|
|
|
+ sPath = System.Text.Encoding.UTF8.GetString(bytes, 0, len);
|
|
|
+ if (!Directory.Exists(sPath))
|
|
|
+ {
|
|
|
+ sPath = null;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ fs.Close();
|
|
|
+ }
|
|
|
+ catch (Exception) { }
|
|
|
}
|
|
|
- else
|
|
|
+
|
|
|
+ if (sPath == null)
|
|
|
{
|
|
|
- return;
|
|
|
+ FolderBrowserDialog folder = new FolderBrowserDialog();
|
|
|
+ folder.Description = "选择文件所在文件夹目录"; //定义在对话框上显示的文本
|
|
|
+ if (folder.ShowDialog() == DialogResult.OK)
|
|
|
+ {
|
|
|
+ sPath = folder.SelectedPath;
|
|
|
+
|
|
|
+ try
|
|
|
+ {
|
|
|
+ FileStream fs = new FileStream(tmpCfg, FileMode.OpenOrCreate, FileAccess.ReadWrite);
|
|
|
+ byte[] bytes = System.Text.Encoding.UTF8.GetBytes(sPath);
|
|
|
+ fs.Write(bytes, 0, bytes.Length);
|
|
|
+ fs.Close();
|
|
|
+ }
|
|
|
+ catch (Exception) { }
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ return;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
|