//刷新单用户下拉框 ygc 2012-9-3 private void RefreshComBoxSingleUser() { List <string> distinctUser = LogTable.SeachLog2("logUser"); cBoxUser.Items.Clear(); foreach (string user in distinctUser) { cBoxUser.Items.Add(user); } if (cBoxUser.Items.Count > 0) { cBoxUser.SelectedIndex = 0; } }
private void UCLogManager_Load(object sender, EventArgs e) { ////log = new LogFile(null, m_strLogFilePath); //this.splitContainer1.SplitterDistance = this.splitContainer1.Width / 5; listView.Items.Clear(); dateTimePickerStart.Value = DateTime.Today; dateTimePickerEnd.Value = DateTime.Today; btnSearch_Click(sender, e); //List<string> list = log.SeachLog(); //for (int i = 0; i < list.Count; i++) //{ // string[] array = list[i].Split('/'); // listView.Items.Add(array[0]); // listView.Items[i].SubItems.Add(array[1]); //} List <string> distinctIP = LogTable.SeachLog2("logIP"); cBoxAccessIP.Items.Clear(); cBoxAccessIP.Items.Add("所有IP"); foreach (string IP in distinctIP) { cBoxAccessIP.Items.Add(IP); } if (cBoxAccessIP.Items.Count > 0) { cBoxAccessIP.SelectedIndex = 0; } //btnSearch_Click(sender, e); List <string> listOper = LogTable.SeachLog2("logEVENT"); comBoxOperation.Items.Clear(); comBoxOperation.Items.Clear(); comBoxOperation.Items.Add("所有操作"); foreach (string Oper in listOper) { comBoxOperation.Items.Add(Oper); } if (comBoxOperation.Items.Count > 0) { comBoxOperation.SelectedIndex = 0; } btnSearch_Click(sender, e); }