日期:2014-05-17 浏览次数:21000 次
string[] txtfile = File.ReadAllLines(@"C:\1.txt", Encoding.GetEncoding("GB2312"));
foreach (var sfile in txtfile)
{
string s_File = sfile.Split(new string[]{" "},StringSplitOptions.RemoveEmptyEntries)[0];
string s_Url =sfile.Split(new string[] {" "},StringSplitOptions.RemoveEmptyEntries)[1];
dgv.Rows.Add{new string[]{s_File,s_Url}}
}
string[] txtfile = File.ReadAllLines(@"C:\1.txt", Encoding.GetEncoding("GB2312"));
foreach (var sfile in txtfile)
{
string[] cloumn = sfile.Split(new string[] { " " }, StringSplitOptions.RemoveEmptyEntries);
this.dataGridView2.Rows.Add(cloumn);
}