最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
一个发邮件的例子,涉及MSMQ,RSA,JMAIL
时间:2022-07-02 11:33:19 编辑:袖梨 来源:一聚教程网
1.先生成公钥密钥
RSACryptoServiceProvider crypt=new RSACryptoServiceProvider();
string publickey=crypt.ToXmlString(false);//(公钥)
string privatekey=crypt.ToXmlString(true);
crypt.Clear();
StreamWriter one=new StreamWriter(@"c:a.txt",true,UTF8Encoding.UTF8);
one.Write(publickey);
StreamWriter two=new StreamWriter(@"c:.txt",true,UTF8Encoding.UTF8);
two.Write(privatekey);
one.Flush();
two.Flush();
one.Close();
two.Close();
Console.WriteLine("成功保存公匙和密匙!");
2.对信息加密,然后用通过队列发送信息
string from=TextBoxFrom.Text+DropDownList2.SelectedValue;
string sub=textBoxSub.Text;
string bodys=TextBoxBody.Text;
string pwd=TextBoxPwd.Text;
StreamReader sr = new StreamReader(@"c:a.txt",UTF8Encoding.UTF8);
string readpublickey = sr.ReadToEnd();
sr.Close();
RSACryptoServiceProvider crypt=new RSACryptoServiceProvider();
UTF8Encoding enc=new UTF8Encoding();
相关文章
- 阴阳师SSR孔雀明王强度介绍 05-20
- 明日方舟CW 05-20
- bitkeep官网下载app 05-20
- Ordi币安卓版官方登录版 05-20
- 《金铲铲之战》怒翼龙阵容装备搭配 05-20
- 欧易trust钱包安卓版2024 05-20