private void button_Start_Click(object sender, EventArgs e) { button_Start.Enabled = false; button_Stop.Enabled = true; string lastError = string.Empty; if (!FilterDriverService.StartFilterService(out lastError)) { isServiceRunning = false; MessageBoxHelper.PrepToCenterMessageBoxOnForm(this); MessageBox.Show("Start encryption service failed with error:" + lastError + ", auto folder encryption service will stop.", "Auto FileCrypt Service", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
public Form_FileCrypt() { GlobalConfig.filterType = FilterAPI.FilterType.FILE_SYSTEM_CONTROL_ENCRYPTION; InitializeComponent(); StartPosition = FormStartPosition.CenterScreen; string lastError = string.Empty; if (!FilterDriverService.StartFilterService(out lastError)) { isServiceRunning = false; MessageBoxHelper.PrepToCenterMessageBoxOnForm(this); MessageBox.Show("Start encryption service failed with error:" + lastError + ", auto folder encryption service will stop.", "Auto FileCrypt Service", MessageBoxButtons.OK, MessageBoxIcon.Error); } InitializeFileCrypt(); }