private void btnClear_Click(object sender, EventArgs e) { //log = new LogFile(null, m_strLogFilePath); //log.ClearLog(this.listView); if (listView.Items.Count == 0) { return; } if (MessageBox.Show("您确定要清空所有日志吗?(清空后不可恢复)", "提示", MessageBoxButtons.OKCancel, MessageBoxIcon.Information) != DialogResult.OK) { return; } LogTable.ClearLog(listView); btnSearch_Click(sender, e); }