zs
2024-11-20 db360479a8f2244ee3af90b39b01184d5dbee457
DataCapture_MA/Form1.cs
@@ -52,10 +52,9 @@
            if (!foundTargetSubnet && ipSelect.Items.Count > 0)
            {
                MessageBox.Show($"未找到网段为 {targetSubnet} 的IP地址,将默认选中第一个IP。", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                //MessageBox.Show($"未找到网段为 {targetSubnet} 的IP地址,将默认选中第一个IP。", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                ipSelect.SelectedIndex = 0;
            }
            to_ipTxt.Text = ipSelect.SelectedItem?.ToString();
            // 初始化 AutoMapper
@@ -70,7 +69,11 @@
            string startupPath = Environment.GetFolderPath(Environment.SpecialFolder.Startup); // 启动文件夹路径
            CreateShortcut(shortcutName, targetPath, startupPath); // 创建快捷方式
            StartReceive(); // 启动程序
            if (ipSelect.Items.Count > 0)
            {
                StartReceive(); // 启动程序
                CreateDatabase();  // 初始化数据库
            }
            // 删除一个月前的数据
            new Thread(AutoDeleteHistoryDate.Handler).Start();