文字檔.txt String.Split(';') 轉陣列
string_str.txt = aaa;bbb;ccc;ddd
try{ System.IO.StreamReader sr = new System.IO.StreamReader("string_str.txt"); string[] connect_string = sr.ReadToEnd().Split(';'); string01 = connect_string[0].ToString(); string02= connect_string[1].ToString(); string03= connect_string[2].ToString(); string04= connect_string[3].ToString(); sr.Close(); }catch { MessageBox.Show("Error"); }
沒有留言:
張貼留言