您好,欢迎来到三六零分类信息网!老站,搜索引擎当天收录,欢迎发信息

如何使用C# FileStream类?

2024/5/3 14:00:09发布19次查看
filestream类提供了用于文件操作(例如读取和写入)的流。
创建一个像这样的对象
filestream fstream = new filestream("d:\ew.txt", filemode.openorcreate);
上面我们使用了 filemode.openorcreate 来打开或创建文件(如果文件尚不存在)。
以下示例展示了如何在 c# 中使用 filestream 类 -using system;using system.io;public class demo { public static void main(string[] args) { filestream fstream = new filestream("d:\ew.txt", filemode.openorcreate); // write into the file fstream.writebyte(90); // close the file fstream.close(); }}
以上就是如何使用c# filestream类?的详细内容。
该用户其它信息

VIP推荐

免费发布信息,免费发布B2B信息网站平台 - 三六零分类信息网 沪ICP备09012988号-2
企业名录 Product