remove System.Web

pull/4655/head
2dust 11 months ago
parent 08c7396404
commit e2f9aac1c9

@ -1,5 +1,6 @@
using Microsoft.Win32;
using Microsoft.Win32.TaskScheduler;
using System.Collections.Specialized;
using System.Diagnostics;
using System.Drawing;
using System.IO;
@ -13,7 +14,6 @@ using System.Security.Cryptography;
using System.Security.Principal;
using System.Text;
using System.Text.RegularExpressions;
using System.Web;
using System.Windows;
using System.Windows.Interop;
using System.Windows.Media;
@ -302,7 +302,33 @@ namespace v2rayN
public static string UrlDecode(string url)
{
return HttpUtility.UrlDecode(url);
return Uri.UnescapeDataString(url);
//return HttpUtility.UrlDecode(url);
}
public static NameValueCollection ParseQueryString(string query)
{
var result = new NameValueCollection(StringComparer.OrdinalIgnoreCase);
if (IsNullOrEmpty(query))
{
return result;
}
var parts = query[1..].Split(new[] { '&' }, StringSplitOptions.RemoveEmptyEntries);
foreach (var part in parts)
{
var keyValue = part.Split(['=']);
if (keyValue.Length != 2)
{
continue;
}
var key = Uri.UnescapeDataString(keyValue[0]);
var val = Uri.UnescapeDataString(keyValue[1]);
result.Add(key, val);
}
return result;
}
public static string GetMD5(string str)

@ -3,7 +3,6 @@ using System.Diagnostics;
using System.IO;
using System.IO.Compression;
using System.Text;
using System.Web;
using System.Windows.Forms;
namespace v2rayUpgrade
@ -18,7 +17,7 @@ namespace v2rayUpgrade
InitializeComponent();
if (args.Length > 0)
{
fileName = HttpUtility.UrlDecode(string.Join(" ", args));
fileName = Uri.UnescapeDataString(string.Join(" ", args));
}
else
{

Loading…
Cancel
Save