mirror of
https://github.com/2dust/v2rayN.git
synced 2025-04-19 21:52:25 +00:00
IDE0018
This commit is contained in:
parent
67b99c4c8b
commit
edea40012c
9 changed files with 10 additions and 22 deletions
|
@ -121,8 +121,7 @@ namespace v2rayN.Forms
|
||||||
{
|
{
|
||||||
ClearServer();
|
ClearServer();
|
||||||
|
|
||||||
string msg;
|
VmessItem vmessItem = V2rayConfigHandler.ImportFromClipboardConfig(Utils.GetClipboardData(), out string msg);
|
||||||
VmessItem vmessItem = V2rayConfigHandler.ImportFromClipboardConfig(Utils.GetClipboardData(), out msg);
|
|
||||||
if (vmessItem == null)
|
if (vmessItem == null)
|
||||||
{
|
{
|
||||||
UI.Show(msg);
|
UI.Show(msg);
|
||||||
|
|
|
@ -110,8 +110,7 @@ namespace v2rayN.Forms
|
||||||
{
|
{
|
||||||
ClearServer();
|
ClearServer();
|
||||||
|
|
||||||
string msg;
|
VmessItem vmessItem = V2rayConfigHandler.ImportFromClipboardConfig(Utils.GetClipboardData(), out string msg);
|
||||||
VmessItem vmessItem = V2rayConfigHandler.ImportFromClipboardConfig(Utils.GetClipboardData(), out msg);
|
|
||||||
if (vmessItem == null)
|
if (vmessItem == null)
|
||||||
{
|
{
|
||||||
UI.Show(msg);
|
UI.Show(msg);
|
||||||
|
|
|
@ -258,8 +258,7 @@ namespace v2rayN.Forms
|
||||||
{
|
{
|
||||||
ClearServer();
|
ClearServer();
|
||||||
|
|
||||||
string msg;
|
VmessItem vmessItem = V2rayConfigHandler.ImportFromClipboardConfig(Utils.GetClipboardData(), out string msg);
|
||||||
VmessItem vmessItem = V2rayConfigHandler.ImportFromClipboardConfig(Utils.GetClipboardData(), out msg);
|
|
||||||
if (vmessItem == null)
|
if (vmessItem == null)
|
||||||
{
|
{
|
||||||
UI.Show(msg);
|
UI.Show(msg);
|
||||||
|
|
|
@ -77,8 +77,7 @@ namespace v2rayN.Forms
|
||||||
{
|
{
|
||||||
//路由
|
//路由
|
||||||
cmbdomainStrategy.Text = config.domainStrategy;
|
cmbdomainStrategy.Text = config.domainStrategy;
|
||||||
int routingMode = 0;
|
int.TryParse(config.routingMode, out int routingMode);
|
||||||
int.TryParse(config.routingMode, out routingMode);
|
|
||||||
cmbroutingMode.SelectedIndex = routingMode;
|
cmbroutingMode.SelectedIndex = routingMode;
|
||||||
|
|
||||||
txtUseragent.Text = Utils.List2String(config.useragent, true);
|
txtUseragent.Text = Utils.List2String(config.useragent, true);
|
||||||
|
|
|
@ -753,7 +753,6 @@ namespace v2rayN.Handler
|
||||||
string[] arrData = clipboardData.Split(Environment.NewLine.ToCharArray());
|
string[] arrData = clipboardData.Split(Environment.NewLine.ToCharArray());
|
||||||
foreach (string str in arrData)
|
foreach (string str in arrData)
|
||||||
{
|
{
|
||||||
string msg;
|
|
||||||
//maybe sub
|
//maybe sub
|
||||||
if (str.StartsWith(Global.httpsProtocol) || str.StartsWith(Global.httpProtocol))
|
if (str.StartsWith(Global.httpsProtocol) || str.StartsWith(Global.httpProtocol))
|
||||||
{
|
{
|
||||||
|
@ -763,7 +762,7 @@ namespace v2rayN.Handler
|
||||||
}
|
}
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
VmessItem vmessItem = V2rayConfigHandler.ImportFromClipboardConfig(str, out msg);
|
VmessItem vmessItem = V2rayConfigHandler.ImportFromClipboardConfig(str, out string msg);
|
||||||
if (vmessItem == null)
|
if (vmessItem == null)
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
|
|
|
@ -102,8 +102,7 @@ namespace v2rayN.Handler
|
||||||
}
|
}
|
||||||
Config configCopy = Utils.DeepCopy(config);
|
Config configCopy = Utils.DeepCopy(config);
|
||||||
configCopy.index = index;
|
configCopy.index = index;
|
||||||
string msg;
|
if (V2rayConfigHandler.Export2ClientConfig(configCopy, fileName, out string msg) != 0)
|
||||||
if (V2rayConfigHandler.Export2ClientConfig(configCopy, fileName, out msg) != 0)
|
|
||||||
{
|
{
|
||||||
UI.Show(msg);
|
UI.Show(msg);
|
||||||
}
|
}
|
||||||
|
@ -143,8 +142,7 @@ namespace v2rayN.Handler
|
||||||
}
|
}
|
||||||
Config configCopy = Utils.DeepCopy(config);
|
Config configCopy = Utils.DeepCopy(config);
|
||||||
configCopy.index = index;
|
configCopy.index = index;
|
||||||
string msg;
|
if (V2rayConfigHandler.Export2ServerConfig(configCopy, fileName, out string msg) != 0)
|
||||||
if (V2rayConfigHandler.Export2ServerConfig(configCopy, fileName, out msg) != 0)
|
|
||||||
{
|
{
|
||||||
UI.Show(msg);
|
UI.Show(msg);
|
||||||
}
|
}
|
||||||
|
|
|
@ -221,8 +221,7 @@ namespace v2rayN.Handler
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
IPAddress ipAddress;
|
if (!System.Net.IPAddress.TryParse(url, out IPAddress ipAddress))
|
||||||
if (!System.Net.IPAddress.TryParse(url, out ipAddress))
|
|
||||||
{
|
{
|
||||||
IPHostEntry ipHostInfo = System.Net.Dns.GetHostEntry(url);
|
IPHostEntry ipHostInfo = System.Net.Dns.GetHostEntry(url);
|
||||||
ipAddress = ipHostInfo.AddressList[0];
|
ipAddress = ipHostInfo.AddressList[0];
|
||||||
|
|
|
@ -120,11 +120,9 @@ namespace v2rayN.Handler
|
||||||
{
|
{
|
||||||
string itemId = config_.getItemId();
|
string itemId = config_.getItemId();
|
||||||
ServerStatItem serverStatItem = GetServerStatItem(itemId);
|
ServerStatItem serverStatItem = GetServerStatItem(itemId);
|
||||||
ulong up = 0,
|
|
||||||
down = 0;
|
|
||||||
|
|
||||||
//TODO: parse output
|
//TODO: parse output
|
||||||
ParseOutput(res.Stat, out up, out down);
|
ParseOutput(res.Stat, out ulong up, out ulong down);
|
||||||
|
|
||||||
serverStatItem.todayUp += up;
|
serverStatItem.todayUp += up;
|
||||||
serverStatItem.todayDown += down;
|
serverStatItem.todayDown += down;
|
||||||
|
|
|
@ -314,9 +314,7 @@ namespace v2rayN
|
||||||
|
|
||||||
public static string HumanFy(ulong amount)
|
public static string HumanFy(ulong amount)
|
||||||
{
|
{
|
||||||
double result;
|
ToHumanReadable(amount, out double result, out string unit);
|
||||||
string unit;
|
|
||||||
ToHumanReadable(amount, out result, out unit);
|
|
||||||
return $"{string.Format("{0:f1}", result)} {unit}";
|
return $"{string.Format("{0:f1}", result)} {unit}";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue