ConfigInfo configInfo = IniConfigHelper.ReadConfigInfo();//获取配置文件 private void ThisAddIn_Startup(object sender, System.EventArgs e) { //Consts.ConfigInfo(); AddToolbar(); CheckIfMenuBarExists(); processExcelJob.application = Application; QuartService.StartJob(configInfo.VkInterval); LogHelper.IsEnable = configInfo.Logon; LogHelper.Info("保存的时间:" + configInfo.VkInterval); }
// Handles the event when a button on the new toolbar is clicked. private void ButtonClick(Office.CommandBarButton ctrl, ref bool cancel) { try { ConfigInfo configInfo = IniConfigHelper.ReadConfigInfo(); QuartService.StartJob(configInfo.VkInterval); ProcessExcelHelper.processExcel(Application); LogHelper.Info("手动点击保存"); MessageBox.Show("保存成功", "提示"); } catch (Exception e) { LogHelper.Error(e); MessageBox.Show(e.Message); } }