C# 把文本中的内容加载到Combox控件中
public static string[] AddDatasToCombox(string path)
{
List<string> array = new List<string>();
if (File.Exists(path))
{
string item;
StreamReader reder = new StreamReader(path, System.Text.Encoding.GetEncoding("GB2312"));
while (reder.Peek() >= 0)
{
try
{
item = reder.ReadLine();
if (item != "")
array.Add(item);
}
catch
{
}
}
}
return array.ToArray();
}