/// <summary> /// 载入webshell数据 /// </summary> public void LoadWebshellData() { int num = 1; lv_shell.Items.Clear(); DataTable dataTable = _shellManager.GetDataTable(); if (dataTable == null) { return; } foreach (DataRow row in dataTable.Rows) { ShellStruct shellStruct = ConvertDataRowToShellStruct(row); string[] items = new string[] { shellStruct.Id, num++.ToString(), shellStruct.TargetId, shellStruct.TargetLevel, shellStruct.Status, shellStruct.ShellUrl, shellStruct.ShellType, shellStruct.ServerCoding, shellStruct.Area, shellStruct.Remark, shellStruct.AddTime }; ListViewItem viewItem = new ListViewItem(items); viewItem.Tag = shellStruct; lv_shell.Items.Add(viewItem); } }
/// <summary> /// 载入webshell数据 /// </summary> public void LoadWebshellData() { int num = 1; lv_shell.Items.Clear(); DataTable dataTable = _shellManager.GetDataTable(); if (dataTable == null) { return; } foreach (DataRow row in dataTable.Rows) { ShellStruct shellStruct = new ShellStruct(); shellStruct.Id = row["id"].ToString(); shellStruct.TargetId = row["target_id"].ToString(); shellStruct.TargetLevel = row["target_level"].ToString(); shellStruct.ShellUrl = row["shell_url"].ToString(); shellStruct.ShellPwd = row["shell_pwd"].ToString(); shellStruct.ShellType = row["shell_type"].ToString(); shellStruct.ShellExtraSetting = row["shell_extra_setting"].ToString(); shellStruct.ServerCoding = row["server_coding"].ToString(); shellStruct.WebCoding = row["web_coding"].ToString(); shellStruct.Area = row["area"].ToString(); shellStruct.Remark = row["remark"].ToString(); shellStruct.AddTime = row["add_time"].ToString(); string[] items = new string[] { shellStruct.Id, num++.ToString(), shellStruct.TargetId, shellStruct.TargetLevel, "-1", shellStruct.ShellUrl, shellStruct.ShellType, shellStruct.ServerCoding, shellStruct.Area, shellStruct.Remark, shellStruct.AddTime }; ListViewItem viewItem = new ListViewItem(items); viewItem.Tag = shellStruct; lv_shell.Items.Add(viewItem); } }
/// <summary> /// 载入webshell数据 /// </summary> public void LoadWebshellData() { DataTable dataTable = ShellManager.GetDataTable(); if (dataTable == null) { return; } var item = new DataStoreCollection <Shell>(); foreach (DataRow row in dataTable.Rows) { Shell shell = DataConvert.ConvertDataRowToShellStruct(row); item.Add(shell); } _gridViewShell.DataStore = item; }