mirror of https://github.com/2dust/v2rayN
IDE0059
parent
2f6236353b
commit
ec3c471df6
|
@ -540,8 +540,7 @@ namespace v2rayN.Handler
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public static int AddCustomServer(ref Config config, string fileName)
|
public static int AddCustomServer(ref Config config, string fileName)
|
||||||
{
|
{
|
||||||
string newFileName = string.Empty;
|
string newFileName = string.Format("{0}.json", Utils.GetGUID());
|
||||||
newFileName = string.Format("{0}.json", Utils.GetGUID());
|
|
||||||
//newFileName = Path.Combine(Utils.GetTempPath(), newFileName);
|
//newFileName = Path.Combine(Utils.GetTempPath(), newFileName);
|
||||||
|
|
||||||
try
|
try
|
||||||
|
|
|
@ -27,8 +27,6 @@ namespace v2rayN.Handler
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public static int GenerateClientConfig(Config config, string fileName, bool blExport, out string msg)
|
public static int GenerateClientConfig(Config config, string fileName, bool blExport, out string msg)
|
||||||
{
|
{
|
||||||
msg = string.Empty;
|
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
//检查GUI设置
|
//检查GUI设置
|
||||||
|
@ -713,8 +711,6 @@ namespace v2rayN.Handler
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public static int GenerateClientCustomConfig(Config config, string fileName, out string msg)
|
public static int GenerateClientCustomConfig(Config config, string fileName, out string msg)
|
||||||
{
|
{
|
||||||
msg = string.Empty;
|
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
//检查GUI设置
|
//检查GUI设置
|
||||||
|
@ -768,8 +764,6 @@ namespace v2rayN.Handler
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public static int GenerateServerConfig(Config config, string fileName, out string msg)
|
public static int GenerateServerConfig(Config config, string fileName, out string msg)
|
||||||
{
|
{
|
||||||
msg = string.Empty;
|
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
//检查GUI设置
|
//检查GUI设置
|
||||||
|
@ -1358,7 +1352,6 @@ namespace v2rayN.Handler
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public static int Export2ClientConfig(Config config, string fileName, out string msg)
|
public static int Export2ClientConfig(Config config, string fileName, out string msg)
|
||||||
{
|
{
|
||||||
msg = string.Empty;
|
|
||||||
return GenerateClientConfig(config, fileName, true, out msg);
|
return GenerateClientConfig(config, fileName, true, out msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1371,7 +1364,6 @@ namespace v2rayN.Handler
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public static int Export2ServerConfig(Config config, string fileName, out string msg)
|
public static int Export2ServerConfig(Config config, string fileName, out string msg)
|
||||||
{
|
{
|
||||||
msg = string.Empty;
|
|
||||||
return GenerateServerConfig(config, fileName, out msg);
|
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)
|
public static int GenerateClientSpeedtestConfig(Config config, List<int> selecteds, string fileName, out string msg)
|
||||||
{
|
{
|
||||||
msg = string.Empty;
|
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
if (config == null
|
if (config == null
|
||||||
|
|
|
@ -42,8 +42,8 @@ namespace v2rayN.Handler
|
||||||
{
|
{
|
||||||
if (Global.reloadV2ray)
|
if (Global.reloadV2ray)
|
||||||
{
|
{
|
||||||
string msg = string.Empty;
|
|
||||||
string fileName = Utils.GetPath(v2rayConfigRes);
|
string fileName = Utils.GetPath(v2rayConfigRes);
|
||||||
|
string msg;
|
||||||
if (V2rayConfigHandler.GenerateClientConfig(config, fileName, false, out msg) != 0)
|
if (V2rayConfigHandler.GenerateClientConfig(config, fileName, false, out msg) != 0)
|
||||||
{
|
{
|
||||||
ShowMsg(false, msg);
|
ShowMsg(false, msg);
|
||||||
|
@ -63,8 +63,8 @@ namespace v2rayN.Handler
|
||||||
{
|
{
|
||||||
if (Global.reloadV2ray)
|
if (Global.reloadV2ray)
|
||||||
{
|
{
|
||||||
string msg = string.Empty;
|
|
||||||
string fileName = Utils.GetPath(v2rayConfigRes);
|
string fileName = Utils.GetPath(v2rayConfigRes);
|
||||||
|
string msg;
|
||||||
if (V2rayConfigHandler.GenerateClientSpeedtestConfig(config, _selecteds, fileName, out msg) != 0)
|
if (V2rayConfigHandler.GenerateClientSpeedtestConfig(config, _selecteds, fileName, out msg) != 0)
|
||||||
{
|
{
|
||||||
ShowMsg(false, msg);
|
ShowMsg(false, msg);
|
||||||
|
|
|
@ -384,10 +384,9 @@ namespace v2rayN.Mode
|
||||||
|
|
||||||
public string getSummary()
|
public string getSummary()
|
||||||
{
|
{
|
||||||
string summary = string.Empty;
|
string summary = string.Format("{0}-", ((EConfigType)configType).ToString());
|
||||||
summary = string.Format("{0}-", ((EConfigType)configType).ToString());
|
|
||||||
string[] arrAddr = address.Split('.');
|
string[] arrAddr = address.Split('.');
|
||||||
string addr = string.Empty;
|
string addr;
|
||||||
if (arrAddr.Length > 2)
|
if (arrAddr.Length > 2)
|
||||||
{
|
{
|
||||||
addr = $"{arrAddr[0]}***{arrAddr[arrAddr.Length - 1]}";
|
addr = $"{arrAddr[0]}***{arrAddr[arrAddr.Length - 1]}";
|
||||||
|
|
|
@ -43,7 +43,6 @@ namespace v2rayN
|
||||||
if (extendedInfoPtr != IntPtr.Zero)
|
if (extendedInfoPtr != IntPtr.Zero)
|
||||||
{
|
{
|
||||||
Marshal.FreeHGlobal(extendedInfoPtr);
|
Marshal.FreeHGlobal(extendedInfoPtr);
|
||||||
extendedInfoPtr = IntPtr.Zero;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -121,7 +121,7 @@ namespace v2rayN
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public static int ToJsonFile(Object obj, string filePath)
|
public static int ToJsonFile(Object obj, string filePath)
|
||||||
{
|
{
|
||||||
int result = -1;
|
int result;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
using (StreamWriter file = File.CreateText(filePath))
|
using (StreamWriter file = File.CreateText(filePath))
|
||||||
|
@ -883,7 +883,6 @@ namespace v2rayN
|
||||||
|
|
||||||
public static string ScanScreen()
|
public static string ScanScreen()
|
||||||
{
|
{
|
||||||
string ret = string.Empty;
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
foreach (Screen screen in Screen.AllScreens)
|
foreach (Screen screen in Screen.AllScreens)
|
||||||
|
@ -921,7 +920,7 @@ namespace v2rayN
|
||||||
Result result = reader.decode(bitmap);
|
Result result = reader.decode(bitmap);
|
||||||
if (result != null)
|
if (result != null)
|
||||||
{
|
{
|
||||||
ret = result.Text;
|
string ret = result.Text;
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue