C#文件访问-创新互联
using System.IO;
using System.Diagnostics;
private void button3_Click(object sender, EventArgs e)
{
OpenFileDialog dig = new OpenFileDialog();
DialogResult result = dig.ShowDialog();
if (result == DialogResult.OK)
{
string path = dig.FileName;
FileStream file = new FileStream(path, FileMode.Open);
StreamReader read = new StreamReader(file, Encoding.UTF8);
string []strSpite = null;
while(true)
{
string strline = read.ReadLine();
if (strline == null || strline.Length == 0) break;
strSpite = strline.Split('\t');
Debug.WriteLine(strSpite[0]+"\t"+strSpite[1]+"\t"+strSpite[0]);
}
}
}utf-8格式的txt文件

另外有需要云服务器可以了解下创新互联scvps.cn,海内外云服务器15元起步,三天无理由+7*72小时售后在线,公司持有idc许可证,提供“云服务器、裸金属服务器、高防服务器、香港服务器、美国服务器、虚拟主机、免备案服务器”等云主机租用服务以及企业上云的综合解决方案,具有“安全稳定、简单易用、服务可用性高、性价比高”等特点与优势,专为企业上云打造定制,能够满足用户丰富、多元化的应用场景需求。
网站标题:C#文件访问-创新互联
本文网址:http://www.jxjierui.cn/article/hjjhs.html


咨询
建站咨询
