private void button1_Click(object sender, EventArgs e) { var rexString = ""; rexString += textBox1.Text + ","; rexString += textBox2.Text + ","; rexString += textBox3.Text + ","; rexString += textBox4.Text + ","; rexString += textBox5.Text + ","; rexString += textBox6.Text + ","; rexString += "\n"; var wr = FileLS.FileWrite("neturl.csv", "utf-8", true); wr.Write(rexString); wr.Flush(); wr.Close(); }
public static List <NetData> getDatasByCsvFile(String fileName) { var reader = FileLS.fileReader(fileName); var datas = new List <NetData>(); while (!reader.EndOfStream) { var line = reader.ReadLine(); var values = line.Split(','); var data = new NetData();; data.netUrl = @values[0]; data.netBookNameRex = @values[1]; data.netLastPageRex = @values[2]; data.netBookTypeRex = @values[3]; data.netBookUrlRex = @values[4]; data.loadPageCount = Convert.ToInt32(values[5]); datas.Add(data); } return(datas); }