c#用链表存储并读取配置文件(代码部分)
2021-06-09 23:10
标签:min 读取 lmin efault exists 配置 赋值 conf file //读取配置参数 //串口数据赋值给textbox //相机数据赋值textbox } c#用链表存储并读取配置文件(代码部分) 标签:min 读取 lmin efault exists 配置 赋值 conf file 原文地址:https://www.cnblogs.com/dengzhekaihua/p/10640882.html
private void loadcofig()
{
//List camra1 = new List();
List
if (File.Exists("config.txt"))
{
StreamReader sr = new StreamReader("config.txt", Encoding.Default);
string line;
string[] ss;
while ((line = sr.ReadLine()) != null)
{
ss = line.Split(‘ ‘, ‘,‘, ‘-‘);
camra.Add(ss);
}
sr.Close();
}
textBox1.Text = camra[1][0];
textBox2.Text = camra[1][1];
textBox3.Text = camra[1][2];
textBox4.Text = camra[1][3];
textBox5.Text = camra[1][4];
Lmax1.Text = camra[3][0];
Lmin1.Text = camra[3][1];
Wmax1.Text = camra[3][2];
Wmin1.Text = camra[3][3];
Area1.Text = camra[3][4];
bgsj1.Text = camra[3][5];
上一篇:c#写入配置文件(text)