zs
2024-11-21 ffa436a9b3ee7ed01c749350f5aed44c7d6e43f6
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)