zs
2024-11-21 aee9f67e702f6467aa1948777251fa1bf85353ec
DataCapture_MA/Form1.cs
@@ -71,7 +71,7 @@
            //string startupPath = Environment.GetFolderPath(Environment.SpecialFolder.Startup); // 启动文件夹路径
            //CreateShortcut(shortcutName, targetPath, startupPath); // 创建快捷方式
            SetRegistryAutoStart("MaDataCapture", Application.ExecutablePath);
            SetRegistryAutoStart("MaDataCapture", Application.ExecutablePath); // 注册表方式实现自启动
            StartReceive(); // 启动程序
            CreateDatabase();  // 初始化数据库
@@ -108,7 +108,7 @@
            }
            catch (Exception ex)
            {
                MessageBox.Show($"设置开机自启动失败:{ex.Message}", "错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
                MessageBox.Show($"设置开机自启动失败:{ex.Message},请进行手动启动", "错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
        private void CaptrueForm_FormClosing(object sender, FormClosingEventArgs e)