社区
C#
帖子详情
c#如何来读入中文内容的txt文件
school0911
2004-03-23 08:01:59
我想把中文内容的txt文件里的内容读到程序里的字符串中,读到的内容都是乱码,请问如何才能读入正确的中文内容?
...全文
83
11
打赏
收藏
c#如何来读入中文内容的txt文件
我想把中文内容的txt文件里的内容读到程序里的字符串中,读到的内容都是乱码,请问如何才能读入正确的中文内容?
复制链接
扫一扫
分享
转发到动态
举报
写回复
配置赞助广告
用AI写文章
11 条
回复
切换为时间正序
请发表友善的回复…
发表回复
打赏红包
school0911
2004-03-24
打赏
举报
回复
哦,谢谢大家了!
yuewenbin
2004-03-23
打赏
举报
回复
System.Text.Encoding.Default
HNU
2004-03-23
打赏
举报
回复
System.Text.Encoding.Default是关键
Aglie
2004-03-23
打赏
举报
回复
using System.IO
StreamReader str=new StreamReader(@"c:\t.txt",System.Text.Encoding.Default);
str.WriteLine("xxxx");
007Delphi
2004-03-23
打赏
举报
回复
StreamReader sr=new StreamReader("c:\\x.txt",System.Text.Encoding.Default);
yanlong
2004-03-23
打赏
举报
回复
http://expert.csdn.net/Expert/topic/2872/2872757.xml?temp=.5741846
dxhdxh2k
2004-03-23
打赏
举报
回复
System.IO.StreamReader sr=new System.IO.StreamReader(@"d:\\test5.txt",System.Text.Encoding.GetEncoding("GB2312"));
starheart
2004-03-23
打赏
举报
回复
up
bitsbird
2004-03-23
打赏
举报
回复
StreamReader sw = File.OpenText(@"d:\a.txt");
string str;
while((str =sw.ReadLine()) != null)
{
textBox2.Text = str;
}
xhan2000
2004-03-23
打赏
举报
回复
StreamReader sr=new StreamReader("c:\\x.txt",System.Text.Encoding.Default);
bitsbird
2004-03-23
打赏
举报
回复
StreamWriter sw = File.CreateText(@"d:\a.txt");
sw.Write("hello");
sw.WriteLine("hello");
sw.Close()
C#
文件
系统的操作
本课程将介绍如何在
C#
中执行读写
文件
操作,读写
文件
夹操作。
C#
中的输入输出(一)——
TXT
文件
读写
C#
应用程序中,总会涉及很多
文件
的输出输入,比如导入
txt
数据,导入Excel数据,以及一些特殊格式的数据,还有就是将数据导出成
txt
、...
C#
应用程序导入,或者读取
txt
文件
主要通过
文件
流的方式来读取,一般有下面三种...
C#
文件
读写操作 [详细]
C#
中的 I/O 类 FileStream 类
C#
中文
本
文件
的读取写入 1) StreamReader 2) StreamWriter 二进制
文件
读写 1) BinaryReader 类 2) BinaryWriter 类
C#
读取
TXT
文件
C#
读取
TXT
文件
实现的一些总结: 1、Niit.
txt
默认在 File_read\bin\Debug
文件
下! 假如你不想程序运行报错,那么就在这个
文件
下建立 1)因为这里咱们是读取文本,所以Niit.
txt
,
内容
自己写一下!留心两点 1.1)...
C#
中StreamReader读取
中文
出现乱码
有时在用
C#
中StreamReader读取
中文
时出现乱码 如: using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Diagnostics; using System.Net; using System.Data.Sql;...
C#
110,539
社区成员
642,577
社区内容
发帖
与我相关
我的任务
C#
.NET技术 C#
复制链接
扫一扫
分享
社区描述
.NET技术 C#
社区管理员
加入社区
获取链接或二维码
近7日
近30日
至今
加载中
查看更多榜单
社区公告
让您成为最强悍的C#开发者
试试用AI创作助手写篇文章吧
+ 用AI写文章