我需要 MD5 哈希作为“登录”之后的第二个参数。
这是代码:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Diagnostics;
using System.Security.Cryptography;
namespace LauncherBeta1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void textBox1_TextChanged(object sender, EventArgs e)
{
}
private void maskedTextBox1_MaskInputRejected(object sender, MaskInputRejectedEventArgs e)
{
}
private void button2_Click(object sender, EventArgs e)
{
var password = System.Text.Encoding.UTF8.GetBytes(maskedTextBox1.Text);
var account = System.Text.Encoding.UTF8.GetBytes(textBox1.Text);
var hmacMD5 = new HMACMD5(password);
var saltedHash = hmacMD5.ComputeHash(account);
string[] args = { "login", saltedHash };
Process.Start("program.exe", String.Join(" ", args));
}
}
}
编译器说该行string[] args = { "login", saltedHash };
有语法问题。什么是正确的语法?