最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
asp.net C#读取中文字符代码
时间:2022-06-25 05:03:09 编辑:袖梨 来源:一聚教程网
asp教程.net c#读取中文字符代码
private static void fnfileprocess()
{
streamreader reader = new streamreader(@"d:1500.txt", encoding.getencoding("gb2312"));
streamwriter writeren = new streamwriter(@"d:english.txt", false, encoding.utf8, 1024);
streamwriter writerch = new streamwriter(@"d:chinese.txt", false, encoding.utf8, 1024);
try
{
int i = 1;
for (string line = reader.readline(); line != null; line = reader.readline())
{
if (i % 2 == 1)
{
writeren.writeline(line);
}
else
{
writerch.writeline(line);
}
i++;
}
console.writeline(i + "tok");
}
catch (exception ex)
{
console.writeline(ex.tostring());
}
finally
{
//不清空缓冲区,得到的文件总是少几十行
writeren.flush();
writerch.flush();
}
}
相关文章
- 《燕云十六声》红尘无眼完成图文攻略 12-25
- 《燕云十六声》阴阳如影完成图文攻略 12-25
- 《燕云十六声》悬檐之下四架椽屋图文攻略 12-25
- 《燕云十六声》2024最新公测时间介绍 12-25
- 《燕云十六声》有没有藏宝阁 12-25
- 《燕云十六声》制作公司介绍 12-25