怎么用c#语言编写一个新建文本文件

[复制链接]
查看11 | 回复3 | 2011-9-7 09:47:28 | 显示全部楼层 |阅读模式
先引入System.IO的命名空间,然后写如下代码 string file = txtFilePath.Text; string content = txtContent.Text;if (!File.Exists(file) == true) {
MessageBox.Show("存在此文件!");
}
else
{
FileStream myFs = new FileStream(file, FileMode.Create);
StreamWrit...
回复

使用道具 举报

千问 | 2011-9-7 09:47:28 | 显示全部楼层
C# 读写 文本文件的例子http://hi.baidu.com/wangzhiqing999/blog/item/08761705319fc4d9277fb5f7.htmlC# 读写 二进制文件的例子http://hi.baidu.com/wangzhiqing999/blog/item/4c69018b0bfa4bf5513d92f1.h...
回复

使用道具 举报

千问 | 2011-9-7 09:47:28 | 显示全部楼层
百度以 下...
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行