
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" "http://www.wapforum.org/DTD/wml_1.1.xml">
<wml>
	<head><meta forua="true" http-equiv="Cache-Control" content="max-age=0" /></head><card id="MainCard" title="&#x6B22;&#x8FCE;&#x5149;&#x4E34;"><p><a href="wap.asp">&#x6728;&#x5B50;&#x5C4B;</a><br/>&nbsp;</p><p><b>&#x6807;&#x9898;&#x3A;</b> &#x43;&#x23;&#x4F7F;&#x7528;&#x42;&#x69;&#x6E;&#x61;&#x72;&#x79;&#x57;&#x72;&#x69;&#x74;&#x65;&#x72;&#x548C;&#x42;&#x69;&#x6E;&#x61;&#x72;&#x79;&#x52;&#x65;&#x61;&#x64;&#x65;&#x72;&#x8BFB;&#x5199;&#x6587;&#x4EF6;</p><p><b>&#x4F5C;&#x8005;&#x3A;</b> &#x64;&#x6E;&#x61;&#x77;&#x6F;</p><p><b>&#x65E5;&#x671F;&#x3A;</b> &#x32;&#x30;&#x31;&#x30;&#x2D;&#x30;&#x31;&#x2D;&#x31;&#x38;&#x20;&#x31;&#x32;&#x3A;&#x30;&#x34;&#x20;&#x41;&#x4D;</p><p><b>&#x5206;&#x7C7B;&#x3A;</b> <a href="wap.asp?do=showLog&amp;cateID=5">&#x57;&#x65;&#x62;&#x7F16;&#x7A0B;</a></p><p><b>&#x5185;&#x5BB9;&#x3A;</b> C#&#x7684;FileStream&#x7C7B;&#x63D0;&#x4F9B;&#x4E86;&#x6700;&#x539F;&#x59CB;&#x7684;&#x5B57;&#x8282;&#x7EA7;&#x4E0A;&#x7684;&#x6587;&#x4EF6;&#x8BFB;&#x5199;&#x529F;&#x80FD;&#xFF0C;&#x4F46;&#x6211;&#x4EEC;&#x4E60;&#x60EF;&#x4E8E;&#x5BF9;&#x5B57;&#x7B26;&#x4E32;&#x64CD;&#x4F5C;&#xFF0C;&#x4E8E;&#x662F;StreamWriter&#x548C;StreamReader&#x7C7B;&#x589E;&#x5F3A;&#x4E86;FileStream&#xFF0C;&#x5B83;&#x8BA9;&#x6211;&#x4EEC;&#x5728;&#x5B57;&#x7B26;&#x4E32;&#x7EA7;&#x522B;&#x4E0A;&#x64CD;&#x4F5C;&#x6587;&#x4EF6;&#xFF0C;&#x4F46;&#x6709;&#x7684;&#x65F6;&#x5019;&#x6211;&#x4EEC;&#x8FD8;&#x662F;&#x9700;&#x8981;&#x5728;&#x5B57;&#x8282;&#x7EA7;&#x4E0A;&#x64CD;&#x4F5C;&#x6587;&#x4EF6;&#xFF0C;&#x5374;&#x53C8;&#x4E0D;&#x662F;&#x4E00;&#x4E2A;&#x5B57;&#x8282;&#x4E00;&#x4E2A;&#x5B57;&#x8282;&#x7684;&#x64CD;&#x4F5C;&#xFF0C;&#x901A;&#x5E38;&#x662F;2&#x4E2A;&#x3001;4&#x4E2A;&#x6216;8&#x4E2A;&#x5B57;&#x8282;&#x8FD9;&#x6837;&#x64CD;&#x4F5C;&#xFF0C;&#x8FD9;&#x4FBF;&#x6709;&#x4E86;BinaryWriter&#x548C;BinaryReader&#x7C7B;&#xFF0C;&#x5B83;&#x4EEC;&#x53EF;&#x4EE5;&#x5C06;&#x4E00;&#x4E2A;&#x5B57;&#x7B26;&#x6216;&#x6570;&#x5B57;&#x6309;&#x6307;&#x5B9A;&#x4E2A;&#x6570;&#x5B57;&#x8282;&#x5199;&#x5165;&#xFF0C;&#x4E5F;&#x53EF;&#x4EE5;&#x4E00;&#x6B21;&#x8BFB;&#x53D6;&#x6307;&#x5B9A;&#x4E2A;&#x6570;&#x5B57;&#x8282;&#x8F6C;&#x4E3A;&#x5B57;&#x7B26;&#x6216;&#x6570;&#x5B57;&#xFF1A;<br/>&#x590D;&#x5236;&#x5185;&#x5BB9;&#x5230;&#x526A;&#x8D34;&#x677F; &#x7A0B;&#x5E8F;&#x4EE3;&#x7801;//&#x5199;&#x5165;<br/>using (FileStream fs = new FileStream(@&#34;D:\Binary&#34;, FileMode.Cr&#101;ate))<br/>{<br/>&nbsp;&nbsp;&nbsp;&nbsp;using (BinaryWriter writer = new BinaryWriter(fs))<br/>&nbsp;&nbsp;&nbsp;&nbsp;{<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;writer.Write(true);<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;writer.Write((byte)1); //&#x7528;1&#x4E2A;&#x5B57;&#x8282;&#x5199;&#x5165;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;writer.Write((short)2); //&#x7528;2&#x4E2A;&#x5B57;&#x8282;&#x5199;&#x5165;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;writer.Write((int)3); //&#x7528;4&#x4E2A;&#x5B57;&#x8282;&#x5199;&#x5165;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;writer.Write((long)4); //&#x7528;8&#x4E2A;&#x5B57;&#x8282;&#x5199;&#x5165;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;writer.Write(new byte[] { 0xFF, 0xD9 });<br/>&nbsp;&nbsp;&nbsp;&nbsp;}<br/>}<br/>//&#x8BFB;&#x53D6;<br/>using (FileStream fs = new FileStream(@&#34;D:\Binary&#34;, FileMode.Open, FileAccess.Read))<br/>{<br/>&nbsp;&nbsp;&nbsp;&nbsp;using (BinaryReader reader = new BinaryReader(fs))<br/>&nbsp;&nbsp;&nbsp;&nbsp;{<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Console.WriteLine(reader.ReadBoolean());<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Console.WriteLine(reader.ReadByte()); //&#x4E00;&#x6B21;&#x8BFB;&#x53D6;1&#x4E2A;&#x5B57;&#x8282;&#x8F6C;&#x4E3A;byte<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Console.WriteLine(reader.ReadInt16()); //&#x4E00;&#x6B21;&#x8BFB;&#x53D6;2&#x4E2A;&#x5B57;&#x8282;&#x8F6C;&#x4E3A;short<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Console.WriteLine(reader.ReadInt32()); //&#x4E00;&#x6B21;&#x8BFB;&#x53D6;4&#x4E2A;&#x5B57;&#x8282;&#x8F6C;&#x4E3A;int<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Console.WriteLine(reader.ReadInt64()); //&#x4E00;&#x6B21;&#x8BFB;&#x53D6;8&#x4E2A;&#x5B57;&#x8282;&#x8F6C;&#x4E3A;long<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;byte[] b = reader.ReadBytes(2);<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;for (int i = 0; i &lt; b.Length; i++)<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Console.Write(Convert.ToString(b[i], 16) + &#34; &#34;);<br/>&nbsp;&nbsp;&nbsp;&nbsp;}<br/>}</p><p> + <a href="#CommentCard">&#x67E5;&#x770B;&#x5F53;&#x524D;&#x65E5;&#x5FD7;&#x8BC4;&#x8BBA;</a> (0)</p><p>&nbsp;<br/><br/><a href="wap.asp?do=Login">&#x767B;&#x5F55;</a></p><p><br/>&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;</p><p><a href="wap.asp">&#x6728;&#x5B50;&#x5C4B;</a></p><p><a href="http://www.pjhome.net/wap.asp">PJBlog3&nbsp;v3.2.9.518</a>&nbsp;Inside.</p><p>Processed&nbsp;In&nbsp;0.031&nbsp;ms</p><do type="prev" label="&#x8FD4;&#x56DE;"><prev/></do></card><card id="postCommentCard"><p><b>&#x6807;&#x9898;&#x3A;</b> <a href="#MainCard">&#x43;&#x23;&#x4F7F;&#x7528;&#x42;&#x69;&#x6E;&#x61;&#x72;&#x79;&#x57;&#x72;&#x69;&#x74;&#x65;&#x72;&#x548C;&#x42;&#x69;&#x6E;&#x61;&#x72;&#x79;&#x52;&#x65;&#x61;&#x64;&#x65;&#x72;&#x8BFB;&#x5199;&#x6587;&#x4EF6;</a></p><p><br/>你没有权限发表评论</p><p><br/>&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;</p><p><a href="wap.asp">&#x6728;&#x5B50;&#x5C4B;</a></p><p><a href="http://www.pjhome.net/wap.asp">PJBlog3&nbsp;v3.2.9.518</a>&nbsp;Inside.</p><p>Processed&nbsp;In&nbsp;0.031&nbsp;ms</p><do type="prev" label="&#x8FD4;&#x56DE;"><prev/></do></card><card id="CommentCard"><p>&#x6682;&#x65E0;&#x8BC4;&#x8BBA;</p><p><a href="#MainCard">&#x8FD4;&#x56DE;</a></p><p><br/>&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;</p><p><a href="wap.asp">&#x6728;&#x5B50;&#x5C4B;</a></p><p><a href="http://www.pjhome.net/wap.asp">PJBlog3&nbsp;v3.2.9.518</a>&nbsp;Inside.</p><p>Processed&nbsp;In&nbsp;0.031&nbsp;ms</p><do type="prev" label="&#x8FD4;&#x56DE;"><prev/></do></card>
</wml>
