private void button2_Click(object sender, EventArgs e) { foreach (string line in File.ReadLines(filePath)) { if (line.Contains("#COLUMNNAME")) { string[] s = line.Split('\t'); for (int i = 0; i <= s.Count() - 1; i++) { DataGridViewColumn columns = new DataGridViewTextBoxColumn(); columns.Name = "col" + i.ToString(); columns.HeaderText = s[i].ToString(); dataGridView1.Columns.Add(columns); } } } }
#COLUMNNAME MapArea MobId MinLevel MaxLevel AbStateCnt MinCen MaxCen CenRate TradeBoxA RateA TradeBoxB RateB TradeBoxC RateC DrItem1 ;
string[] s = line.Replace("#COLUMNNAME", "").Trim().Split('\t');
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)