mirror of https://github.com/2dust/v2rayN
commit
35deb0c915
|
@ -48,8 +48,8 @@ namespace v2rayN.Forms
|
|||
}
|
||||
rulesItem.inboundTag = inboundTag;
|
||||
rulesItem.outboundTag = cmbOutboundTag.Text;
|
||||
rulesItem.domain = Utils.String2List(txtDomain.Text);
|
||||
rulesItem.ip = Utils.String2List(txtIP.Text);
|
||||
rulesItem.domain = Utils.String2ListSorted(txtDomain.Text);
|
||||
rulesItem.ip = Utils.String2ListSorted(txtIP.Text);
|
||||
|
||||
var protocol = new List<string>();
|
||||
for (int i = 0; i < clbProtocol.Items.Count; i++)
|
||||
|
|
|
@ -219,6 +219,26 @@ namespace v2rayN
|
|||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 逗号分隔的字符串,先排序后转List<string>
|
||||
/// </summary>
|
||||
/// <param name="str"></param>
|
||||
/// <returns></returns>
|
||||
public static List<string> String2ListSorted(string str)
|
||||
{
|
||||
try
|
||||
{
|
||||
str = str.Replace(Environment.NewLine, "");
|
||||
List<string> list = new List<string>(str.Split(new string[] { "," }, StringSplitOptions.RemoveEmptyEntries));
|
||||
return list.OrderBy(x => x).ToList();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
SaveLog(ex.Message, ex);
|
||||
return new List<string>();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Base64编码
|
||||
/// </summary>
|
||||
|
|
Loading…
Reference in New Issue