{"id":64,"date":"2006-12-01T15:53:14","date_gmt":"2006-12-01T15:53:14","guid":{"rendered":""},"modified":"2006-12-01T15:53:14","modified_gmt":"2006-12-01T15:53:14","slug":"64","status":"publish","type":"post","link":"https:\/\/3v.org.cn\/?p=64","title":{"rendered":"\u4eca\u5929\u6709\u70b9\u51b7&#8230;.\u98ce\u5439\u5439~~~\u505a\u516c\u53f8\u7684\u8bba\u575bDZ\u6a21\u7248&#8230;"},"content":{"rendered":"<p>\u53bb\u7f51\u4e0a\u770b\u4e86\u4e00\u4e9bDZ\u7684\u6a21\u7248,,NND,,\u5374\u662fBase64\u52a0\u5bc6&#8230;\u5475\u5475..\u6709\u70b9\u4e0d\u723d&#8230;\u4e0d\u8fc7..\u8fd8\u662f\u6709\u65b9\u6cd5\u5f04\u51fa\u6765\u7684..\u77a7\u4e00\u77a7..<\/p>\n<p>\u4e0b\u9762\u7559\u4e0b\u65b9\u6cd5<\/p>\n<p>Base64\u8f6c\u6362<br \/>\u65b0\u5efa\u4e00\u4e2aWindows\u5e94\u7528\u7a0b\u5e8f\uff0c\u4e00\u4e2a\u6587\u672c\u6846\uff0c\u4e24\u4e2a\u6309\u94ae\uff1a<br \/>\/\/\u6dfb\u52a0\u4e24\u4e2aCryptoStream\uff0c\u4f46\u987a\u5e8f\u76f8\u53cd<br \/>private void btnWrite_Click(object sender, System.EventArgs e)<br \/>{<br \/>\/\/open a file for writting to<br \/>FileStream fs=new FileStream(&#8220;I:\\testfile.txt&#8221;,FileMode.Create);<\/p>\n<p>\/\/create a stream for converting to base64 encoding<br \/>ICryptoTransform transformEncode=new ToBase64Transform();<br \/>CryptoStream csEncode=new CryptoStream(fs,transformEncode,CryptoStreamMode.Write);<\/p>\n<p>\/\/create a stream for encryption<br \/>ICryptoTransform transformEncrypt=crypt.CreateEncryptor();<br \/>CryptoStream csEncrypt=new CryptoStream(csEncode,transformEncrypt,CryptoStreamMode.Write);<\/p>\n<p>\/\/create a text writer<br \/>StreamWriter w=new StreamWriter(csEncrypt);<br \/>w.Write(this.txtMessage.Text);<\/p>\n<p>w.Flush();<br \/>csEncrypt.FlushFinalBlock();<\/p>\n<p>w.Close();<br \/>MessageBox.Show(&#8220;\u6587\u4ef6\u521b\u5efa\u6210\u529f\uff01&#8221;);<br \/>}<\/p>\n<p>\/\/\u5c06\u4fe1\u606f\u8f6c\u6362\u4e3a\u539f\u6765\u7684\u5f62\u5f0f\uff0c\u7136\u540e\u518dJEM<br \/>private void btnRead_Click(object sender, System.EventArgs e)<br \/>{<br \/>\/\/open a file for reading from<br \/>FileStream fs=new FileStream(&#8220;I:\\testfile.txt&#8221;,FileMode.Open);<\/p>\n<p>\/\/create a stream for converting from Base64 encoding<br \/>ICryptoTransform transformDecode=new FromBase64Transform();<br \/>CryptoStream csDecode=new CryptoStream(fs,transformDecode,CryptoStreamMode.Read);<\/p>\n<p>\/\/create a cryptographic stream<br \/>ICryptoTransform transformDecrypt=crypt.CreateDecryptor();<br \/>CryptoStream csDecrypt=new CryptoStream(csDecode,transformDecrypt,CryptoStreamMode.Read);<\/p>\n<p>\/\/create a text reader<br \/>StreamReader r=new StreamReader(csDecrypt);<br \/>string text=r.ReadToEnd();<br \/>r.Close();<\/p>\n<p>MessageBox.Show(&#8220;Retrived:&#8221;+text);<br \/>this.txtMessage.Text=text;<br \/>} <\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u53bb\u7f51\u4e0a\u770b\u4e86\u4e00\u4e9bDZ\u7684\u6a21\u7248,,NND,,\u5374\u662fBase64\u52a0\u5bc6&#8230;\u5475\u5475..\u6709\u70b9\u4e0d\u723d&#8230;\u4e0d\u8fc7..<\/p>\n<div class=\"more-link\">\n\t\t\t\t <a href=\"https:\/\/3v.org.cn\/?p=64\" class=\"link-btn theme-btn\"><span>Read More <\/span> <i class=\"fa fa-caret-right\"><\/i><\/a>\n\t\t\t<\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_seopress_robots_primary_cat":"","_seopress_titles_title":"","_seopress_titles_desc":"","_seopress_robots_index":"","footnotes":""},"categories":[2],"tags":[],"class_list":["post-64","post","type-post","status-publish","format-standard","hentry","category-2"],"_links":{"self":[{"href":"https:\/\/3v.org.cn\/index.php?rest_route=\/wp\/v2\/posts\/64","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/3v.org.cn\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/3v.org.cn\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/3v.org.cn\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/3v.org.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=64"}],"version-history":[{"count":0,"href":"https:\/\/3v.org.cn\/index.php?rest_route=\/wp\/v2\/posts\/64\/revisions"}],"wp:attachment":[{"href":"https:\/\/3v.org.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=64"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/3v.org.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=64"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/3v.org.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=64"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}