Skip to content

Commit 8072860

Browse files
authored
Merge pull request #15 from Cp0204/master
支持多开自启 #11
2 parents a238425 + 11b1d56 commit 8072860

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

FrpClient-Win/MainForm.cs

+15-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
using System.Security.Principal;
44
using System.Windows.Forms;
55
using Microsoft.Win32;
6+
using System.Security.Cryptography;
7+
using System.Text;
68

79
namespace FrpClient_Win
810
{
@@ -11,9 +13,21 @@ public partial class MainForm : Form
1113
Process frp_process = null;
1214
bool bStatus = false;
1315
bool sStatus = false;
14-
const string strRegName = "FrpClient";
16+
string strRegName = "FrpClient_" + MD5Encrypt32(System.Windows.Forms.Application.StartupPath).Substring(0, 6);
1517
const string strAutoRun = "autorun";
1618

19+
// 32位的MD5加密
20+
public static string MD5Encrypt32(string password) {
21+
string cl = password;
22+
string pwd = "";
23+
MD5 md5 = MD5.Create();
24+
byte[] s = md5.ComputeHash(Encoding.UTF8.GetBytes(cl));
25+
for(int i = 0; i < s.Length; i++) {
26+
pwd = pwd + s[i].ToString("x");
27+
}
28+
return pwd;
29+
}
30+
1731
public MainForm()
1832
{
1933
InitializeComponent();

0 commit comments

Comments
 (0)