pull/543/head
YFdyh000 2020-03-15 08:23:17 +08:00
parent 2f6236353b
commit ec3c471df6
6 changed files with 7 additions and 21 deletions

View File

@ -540,8 +540,7 @@ namespace v2rayN.Handler
/// <returns></returns>
public static int AddCustomServer(ref Config config, string fileName)
{
string newFileName = string.Empty;
newFileName = string.Format("{0}.json", Utils.GetGUID());
string newFileName = string.Format("{0}.json", Utils.GetGUID());
//newFileName = Path.Combine(Utils.GetTempPath(), newFileName);
try

View File

@ -27,8 +27,6 @@ namespace v2rayN.Handler
/// <returns></returns>
public static int GenerateClientConfig(Config config, string fileName, bool blExport, out string msg)
{
msg = string.Empty;
try
{
//检查GUI设置
@ -713,8 +711,6 @@ namespace v2rayN.Handler
/// <returns></returns>
public static int GenerateClientCustomConfig(Config config, string fileName, out string msg)
{
msg = string.Empty;
try
{
//检查GUI设置
@ -768,8 +764,6 @@ namespace v2rayN.Handler
/// <returns></returns>
public static int GenerateServerConfig(Config config, string fileName, out string msg)
{
msg = string.Empty;
try
{
//检查GUI设置
@ -1358,7 +1352,6 @@ namespace v2rayN.Handler
/// <returns></returns>
public static int Export2ClientConfig(Config config, string fileName, out string msg)
{
msg = string.Empty;
return GenerateClientConfig(config, fileName, true, out msg);
}
@ -1371,7 +1364,6 @@ namespace v2rayN.Handler
/// <returns></returns>
public static int Export2ServerConfig(Config config, string fileName, out string msg)
{
msg = string.Empty;
return GenerateServerConfig(config, fileName, out msg);
}
@ -1421,8 +1413,6 @@ namespace v2rayN.Handler
public static int GenerateClientSpeedtestConfig(Config config, List<int> selecteds, string fileName, out string msg)
{
msg = string.Empty;
try
{
if (config == null

View File

@ -42,8 +42,8 @@ namespace v2rayN.Handler
{
if (Global.reloadV2ray)
{
string msg = string.Empty;
string fileName = Utils.GetPath(v2rayConfigRes);
string msg;
if (V2rayConfigHandler.GenerateClientConfig(config, fileName, false, out msg) != 0)
{
ShowMsg(false, msg);
@ -63,8 +63,8 @@ namespace v2rayN.Handler
{
if (Global.reloadV2ray)
{
string msg = string.Empty;
string fileName = Utils.GetPath(v2rayConfigRes);
string msg;
if (V2rayConfigHandler.GenerateClientSpeedtestConfig(config, _selecteds, fileName, out msg) != 0)
{
ShowMsg(false, msg);

View File

@ -384,10 +384,9 @@ namespace v2rayN.Mode
public string getSummary()
{
string summary = string.Empty;
summary = string.Format("{0}-", ((EConfigType)configType).ToString());
string summary = string.Format("{0}-", ((EConfigType)configType).ToString());
string[] arrAddr = address.Split('.');
string addr = string.Empty;
string addr;
if (arrAddr.Length > 2)
{
addr = $"{arrAddr[0]}***{arrAddr[arrAddr.Length - 1]}";

View File

@ -43,7 +43,6 @@ namespace v2rayN
if (extendedInfoPtr != IntPtr.Zero)
{
Marshal.FreeHGlobal(extendedInfoPtr);
extendedInfoPtr = IntPtr.Zero;
}
}
}

View File

@ -121,7 +121,7 @@ namespace v2rayN
/// <returns></returns>
public static int ToJsonFile(Object obj, string filePath)
{
int result = -1;
int result;
try
{
using (StreamWriter file = File.CreateText(filePath))
@ -883,7 +883,6 @@ namespace v2rayN
public static string ScanScreen()
{
string ret = string.Empty;
try
{
foreach (Screen screen in Screen.AllScreens)
@ -921,7 +920,7 @@ namespace v2rayN
Result result = reader.decode(bitmap);
if (result != null)
{
ret = result.Text;
string ret = result.Text;
return ret;
}
}