本文介绍了生成ASCII并创建文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
你好,
我试图通过FIRST输入十进制值生成ASCII字符,然后创建一个外部文件来保存字符 。有人可以告诉我如何做到这一点。我对Filestream Class有很多问题,一个错误接着另一个。这非常复杂。
Hello,
I am trying to generate ASCII Characters by FIRST entering the decimal value and then creating a external file to save the Characters. Can someone please show me how to do this. I having many problems with the Filestream Class, one error after the other. This is very complicated.
推荐答案
byte[] data = new byte[] {72, 101, 108, 108, 111, 13, 10};
File.WriteAllBytes(@"D:\Temp\MyFile.txt", data);
将文本Hello和换行符写入文件......
Will write the text "Hello" and a newline to the file...
这篇关于生成ASCII并创建文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!