[C#] C#读取文本文件到listbox组件 →→→→→进入此内容的聊天室

来自 , 2020-09-22, 写在 C#, 查看 127 次.
URL http://www.code666.cn/view/e355ad06
  1. private void AddTxtToLst(string path,ListBox lst)
  2. {
  3.     StreamReader file = new StreamReader(path,Encoding.Default);
  4.     string s = "";
  5.     while (s != null)
  6.     {
  7.         s = file.ReadLine();
  8.         if (!string.IsNullOrEmpty(s))
  9.             lst.Items.Add(s);
  10.     }
  11.     file.Close();
  12. }
  13. //csharp/6993

回复 "C#读取文本文件到listbox组件"

这儿你可以回复上面这条便签

captcha