[英]how to create secret key automatically after 5 minute in C# windows application
I create one function in Class file: 我在Class文件中创建一个函数:
public string createprivacykey(string s3)
{
prky = Convert.ToString(s3);
return prky;
}
and function call in Windows form on button click event: 按钮单击事件时,以Windows形式调用和函数:
private void button1_Click(object sender, EventArgs e)
{
string clearText = textBox2.Text.Trim();
string ciphertext=Class1.Encrypt(clearText,true);
// txtDecryptedText.Visible = false;
//label3.Visible = false;
textBox2.Text = ciphertext;
label3.Visible = true;
label5.Visible = true;
label4.Visible = true;
Random val = new Random();
int randomnumber1 = val.Next(1001, 50000);
ra = Convert.ToString(randomnumber1);
str = cs.createprivacykey(ra);
label5.Text = str.ToString();
}
but i want to key regenerate automatically after 5 minute how to generate key 但是我想在5分钟后自动重新生成密钥
Add a timer to your form using the designer: 使用设计器将计时器添加到表单中:
Some improvements: 一些改进:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.