add multiple program auto run

This commit is contained in:
2dust 2022-05-12 08:52:40 +08:00
parent e256ec5401
commit 3575291119

View file

@ -23,6 +23,7 @@ using Newtonsoft.Json.Linq;
using System.Web;
using log4net;
using System.Linq;
using System.Security.Cryptography;
namespace v2rayN
{
@ -397,6 +398,20 @@ namespace v2rayN
{
return HttpUtility.UrlDecode(url);
}
public static string GetMD5(string str)
{
var md5 = MD5.Create();
byte[] byteOld = Encoding.UTF8.GetBytes(str);
byte[] byteNew = md5.ComputeHash(byteOld);
StringBuilder sb = new StringBuilder();
foreach (byte b in byteNew)
{
sb.Append(b.ToString("x2"));
}
return sb.ToString();
}
#endregion
@ -529,7 +544,13 @@ namespace v2rayN
#region
private static string autoRunName = "v2rayNAutoRun";
private static string autoRunName
{
get
{
return $"v2rayNAutoRun_{GetMD5(StartupPath())}";
}
}
private static string autoRunRegPath
{
get