读写txt
FileStream fileStr = new FileStream("shaftCofig.txt", FileMode.OpenOrCreate);
StreamReader strReader = new StreamReader(fileStr, UnicodeEncoding.GetEncoding("GB2312"));
string data = string.Empty;
string shaftStr = "";
while ((data = strReader.ReadLine()) != null)
{
//shaftStr = shaftStr+ data + "\r\n";
}
fileStr.Close();
FileStream fileStr = new FileStream("shaftCofig.txt", FileMode.Create);
StreamWriter writer = new StreamWriter(fileStr, UnicodeEncoding.GetEncoding("GB2312"));
writer.WriteLine(aa);
writer.Close();
读写txt的更多相关文章
- [转载]C#读写txt文件的两种方法介绍
C#读写txt文件的两种方法介绍 by 大龙哥 1.添加命名空间 System.IO; System.Text; 2.文件的读取 (1).使用FileStream类进行文件的读取,并将它转换成char ...
- C#读写txt文件的两种方法介绍
C#读写txt文件的两种方法介绍 1.添加命名空间 System.IO; System.Text; 2.文件的读取 (1).使用FileStream类进行文件的读取,并将它转换成char数组,然后输出 ...
- WPF 读写TxT文件
原文:WPF 读写TxT文件 文/嶽永鹏 WPF 中读取和写入TxT 是经常性的操作,本篇将从详细演示WPF如何读取和写入TxT文件. 首先,TxT文件希望逐行读取,并将每行读取到的数据作为一个数组的 ...
- java指定编码的按行读写txt文件(几种读写方式的比较)
转: java指定编码的按行读写txt文件(几种读写方式的比较) 2018年10月16日 20:40:02 Handoking 阅读数:976 版权声明:本文为博主原创文章,未经博主允许不得转载. ...
- python操作txt文件中数据教程[1]-使用python读写txt文件
python操作txt文件中数据教程[1]-使用python读写txt文件 觉得有用的话,欢迎一起讨论相互学习~Follow Me 原始txt文件 程序实现后结果 程序实现 filename = '. ...
- C#读写txt文件的两种方法介绍[转]
C#读写txt文件的两种方法介绍 1.添加命名空间 System.IO; System.Text; 2.文件的读取 (1).使用FileStream类进行文件的读取,并将它转换成char数组,然后输出 ...
- C#读写txt文件的两种方法介绍 v
C#读写txt文件的两种方法介绍 1.添加命名空间 System.IO; System.Text; 2.文件的读取 (1).使用FileStream类进行文件的读取,并将它转换成char数组,然后输出 ...
- unity3d读写txt
http://www.cnblogs.com/sunet/p/3851353.html?utm_source=tuicool 记录一下昨天用到的技术点:基于android平台unity3d读写txt. ...
- UNICODE环境下读写txt文件操作
内容转载自http://blog.sina.com.cn/s/blog_5d2bad130100t0x9.html UNICODE环境下读写txt文件操作 (2011-07-26 17:40:05) ...
- MFC读写.txt文件时进度条显示实时进度
整体实现方式:先获得文件长度,然后用每次读取的长度,计算出完成的百分比,用百分比的值设置进度条. 一.MFC进度条 Progress Control 相关函数 1. create() --创建Prog ...
随机推荐
- Win10系列:C#应用控件进阶2
矩形 若要绘制矩形需要用到Rectangle元素,通过指定Rectangle元素的Width和Height属性值来确定矩形的尺寸.而设置RadiusX和RadiusY属性值能得到圆角的矩形,这两个属性 ...
- 浮点型的三个特殊值 Double.NEGATIVE_INFINITY Double.POSITIVE_INFINITY Double.NaN
Double.NEGATIVE_INFINITY 负无穷 Double.POSITIVE_INFINITY 正无穷 Double.NaN 非数 注意:浮点数才有无穷的概念,整数是没有的 比如: int ...
- [Codeforces613E]Puzzle Lover
Problem 给你2*n的格子,每个格子有一个字母,从任意一点出发,不重复的经过上下左右,生成要求的字符串.问有几种不同的走法. Solution 分三段,左U型.中间.右U型. 分别枚举左边和右边 ...
- express源码分析
参考:http://www.cnblogs.com/ginobilee/p/6906204.html https://www.cnblogs.com/zhusheng2008/p/5264096.ht ...
- ssh语法高亮
借助于ssh,使用vi/vim进行文本编辑的语法高亮显示的方法如下: 第一步:设置vi别名 在Linux中,.bashrc与.bash_profile文件为当前用户登录时所执行的,/etc/bashr ...
- ubuntu1604使用之旅——启动ssh系列
---恢复内容开始--- 1.安装ssh的client和server: sudo apt-get install openssh-server openssh-client 2.然后就要安装key: ...
- java readProperties
@Deprecated public static Map<String, String> readProperties(String propertiesFile) { Properti ...
- L332 NBA: Dwyane Wade and Dirk Nowitzki Say Emotional Goodbyes
Two games in the NBA ended amid emotional scenes on Tuesday as legends at separate teams marked thei ...
- vue与mapbox
1.引入mapbox 在index.html里面引入maobox gl 或者使用 npm install mapbox-gl 2.功能 我主要这次要实现 地图展示 地图打点(添加Marker) 地图的 ...
- 用vs2008打开vs2005项目
1 使用记事本打开*.sln解决方案文件,将Visual Studio 2005改为Visual Studio 2008 将版本号改为9.00 2 打开扩展名为*.csproj的项目文件,在Defau ...