原来用vb写的生成.txt文件,很整齐:
240002 宝康灵活配置 1.6239 3.1639
240001 宝康消费品 1.2934 2.9511
240003 宝康债券 1.2151 1.3851
----------------------
asp.net读取.txt 后放入表格里面为:240001 宝康消费品 1.2934 2.9511
213003 宝盈策略增长 1.3348 1.3348
050002 博时裕富 1.0340 3.0140显示不整齐,不知道是vb出的问题,还是asp.net(c#)
using (StreamReader sr1 = new StreamReader(Server.MapPath("news") + "\\xxx.txt",System.Text.Encoding.GetEncoding("GB2312")))
{
//读取指定的文件模板
while ( sr1.ReadLine() != null)
str1 += sr1.ReadLine().Trim() +"<br/>";
sr1.Close();
240002 宝康灵活配置 1.6239 3.1639
240001 宝康消费品 1.2934 2.9511
240003 宝康债券 1.2151 1.3851
----------------------
asp.net读取.txt 后放入表格里面为:240001 宝康消费品 1.2934 2.9511
213003 宝盈策略增长 1.3348 1.3348
050002 博时裕富 1.0340 3.0140显示不整齐,不知道是vb出的问题,还是asp.net(c#)
using (StreamReader sr1 = new StreamReader(Server.MapPath("news") + "\\xxx.txt",System.Text.Encoding.GetEncoding("GB2312")))
{
//读取指定的文件模板
while ( sr1.ReadLine() != null)
str1 += sr1.ReadLine().Trim() +"<br/>";
sr1.Close();
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货