25111701 参数批量通道保存

This commit is contained in:
moxiliang
2025-11-17 14:10:55 +08:00
parent 920ead4a18
commit 6958075f22
39 changed files with 887 additions and 497 deletions

View File

@@ -13,39 +13,10 @@ namespace SLC1_N
private void LogOn_Load(object sender, EventArgs e)
{
Logtime.Text = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
Timer1.Interval = 1000;
Timer1.Start();
//try
//{
// string filepath = System.Environment.CurrentDirectory + "\\Config\\Users\\UsersInfo.mdb";
// if (File.Exists(filepath) == true)//判断所选路径是否有文件
// {
Timer_timeShow.Interval = 1000;
Timer_timeShow.Start();
// string constr = "Provider=Microsoft.Jet.OLEDB.4.0;" + "Data Source=" + System.Environment.CurrentDirectory + "\\Config\\Users\\UsersInfo.mdb;";
// OleDbConnection con = new OleDbConnection(constr);
// con.Open();
// string sql2 = "SELECT * FROM UserInfo";
// OleDbCommand cmd2 = new OleDbCommand(sql2, con);
// OleDbDataReader userinformation = cmd2.ExecuteReader();
// //下移游标读取一行如果没有数据了则返回false
// while (userinformation.Read())
// {
// Account.Items.Add(Convert.ToString(userinformation["账户"]));
// }
// userinformation.Close();
// con.Close();
// }
//}
//catch (Exception ex)
//{
// MessageBox.Show(ex.Message);
//}
Password.Focus();
}
@@ -53,109 +24,24 @@ namespace SLC1_N
{
try
{
if (Password.Text == "linglong29529959" || Password.Text == "29529959" || Password.Text == "qwe")
{
Timer1.Stop();
//Form1.f1.网络设置ToolStripMenuItem.Enabled = true;
//Form1.f1.pLC控制ToolStripMenuItem.Enabled = true;
//Form1.f1.串口配置ToolStripMenuItem.Enabled = true;
//Form1.f1.测试参数ToolStripMenuItem.Enabled = true;
//Form1.f1.基本设置ToolStripMenuItem.Enabled = true;
//Form1.f1.存储设置ToolStripMenuItem.Enabled = true;
//Form1.f1.用户管理ToolStripMenuItem.Enabled = true;
//Form1.f1.
//ToolStripMenuItem.Enabled = true;
Timer_timeShow.Stop();
Form1.f1.lb_User.Text = "厂商";
Form1.f1.User = "厂商";
//Form1.f1.DayTime.Start();
this.Close();
//Form1.f1.Show();
}
else
{
//string filepath = System.Environment.CurrentDirectory + "\\Config\\Users\\UsersInfo.mdb";
//if (File.Exists(filepath) == false)//判断所选路径是否有文件
//{
// MessageBox.Show("请先新建用户!");
//}
//else if (String.IsNullOrEmpty(Account.Text))
//{
// MessageBox.Show("请先选择用户!");
//}
//else
//{
//string constr = "Provider=Microsoft.Jet.OLEDB.4.0;" + "Data Source=" + System.Environment.CurrentDirectory + "\\Config\\Users\\UsersInfo.mdb;";
//OleDbConnection con = new OleDbConnection(constr);
//con.Open();
//string sql = "SELECT * FROM UserInfo WHERE 账户='" + Account.Text + "'";
//OleDbCommand cmd2 = new OleDbCommand(sql, con);
//OleDbDataReader userinformation = cmd2.ExecuteReader();
//string userpassword = null;
//string usercharacter = null;
//while (userinformation.Read())
//{
// userpassword = Convert.ToString(userinformation["密码"]);
// usercharacter = Convert.ToString(userinformation["权限"]);
//}
//userinformation.Close();
//con.Close();
string userpassword2 = DateTime.Now.ToString("yyMMHH");
string userpassword = DateTime.Now.ToString("ddHHmm");
string userpassword3 = "ghkj.2021";
if (Password.Text == userpassword)
{
//Form1.f1.Admin.Text = Account.Text;
Form1.f1.lb_User.Text = "工程师";
Form1.f1.User = "工程师";
Timer1.Stop();
//if (usercharacter == "操作员")
//{
// Form1.f1.网络设置ToolStripMenuItem.Enabled = false;
// Form1.f1.pLC控制ToolStripMenuItem.Enabled = false;
// Form1.f1.串口配置ToolStripMenuItem.Enabled = false;
// Form1.f1.测试参数ToolStripMenuItem.Enabled = false;
// Form1.f1.基本设置ToolStripMenuItem.Enabled = false;
// Form1.f1.存储设置ToolStripMenuItem.Enabled = false;
// Form1.f1.用户管理ToolStripMenuItem.Enabled = false;
// Form1.f1.复位ToolStripMenuItem.Enabled = false;
//}
//else
//{
// Form1.f1.网络设置ToolStripMenuItem.Enabled = true;
// Form1.f1.pLC控制ToolStripMenuItem.Enabled = true;
// Form1.f1.串口配置ToolStripMenuItem.Enabled = true;
// Form1.f1.测试参数ToolStripMenuItem.Enabled = true;
// Form1.f1.基本设置ToolStripMenuItem.Enabled = true;
// Form1.f1.存储设置ToolStripMenuItem.Enabled = true;
// Form1.f1.用户管理ToolStripMenuItem.Enabled = true;
// Form1.f1.复位ToolStripMenuItem.Enabled = true;
//}
//Form1.f1.DayTime.Start();
//string logintime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
////写入登录记录
//record_con.Open();
//string sql2 = " INSERT INTO Login(账户, 登录时间) VALUES('" + Account.Text + "', '" + logintime + "')";
//OleDbCommand record_cmd = new OleDbCommand(sql2, record_con);
//record_cmd.ExecuteNonQuery();
//record_con.Close();
//Form1.f1.Show();
//Machine mac = new Machine(usercharacter);
//mac.ShowDialog();
Timer_timeShow.Stop();
this.Close();
}
@@ -163,14 +49,14 @@ namespace SLC1_N
{
Form1.f1.lb_User.Text = "管理员";
Form1.f1.User = "管理员";
Timer1.Stop();
Timer_timeShow.Stop();
this.Close();
}
else if (Password.Text == userpassword3|| Password.Text == "123456" || Password.Text == "8888")
{
Form1.f1.lb_User.Text = "超级管理员";
Form1.f1.User = "超级管理员";
Timer1.Stop();
Timer_timeShow.Stop();
this.Close();
}
else
@@ -179,8 +65,6 @@ namespace SLC1_N
Password.ResetText();
Password.Focus();
}
//}
}
}
catch (Exception ex)