pull/266/head
2dust 2019-10-30 14:07:26 +08:00
parent ad406c3682
commit 7d31c2e472
2 changed files with 13 additions and 3 deletions

View File

@ -515,11 +515,11 @@ namespace v2rayN.Handler
{
string newFileName = string.Empty;
newFileName = string.Format("{0}.json", Utils.GetGUID());
newFileName = Path.Combine(Utils.GetTempPath(), newFileName);
//newFileName = Path.Combine(Utils.GetTempPath(), newFileName);
try
{
File.Copy(fileName, newFileName);
File.Copy(fileName, Path.Combine(Utils.GetTempPath(), newFileName));
}
catch
{

View File

@ -688,11 +688,21 @@ namespace v2rayN.Handler
return -1;
}
string addressFileName = config.address();
if (File.Exists(fileName))
{
File.Delete(fileName);
}
string addressFileName = config.address();
if (!File.Exists(addressFileName))
{
addressFileName = Path.Combine(Utils.GetTempPath(), addressFileName);
}
if (!File.Exists(addressFileName))
{
msg = UIRes.I18N("FailedGenDefaultConfiguration");
return -1;
}
File.Copy(addressFileName, fileName);
msg = string.Format(UIRes.I18N("SuccessfulConfiguration"), config.getSummary());