public async Task DownloadCrawlerDataAsync() { var trackedTasks = new List <Task>(); _blog.CreateDataFolder(); try { while (await _xmlQueue.OutputAvailableAsync(_ct)) { CrawlerData <XDocument> downloadItem = (CrawlerData <XDocument>) await _xmlQueue.ReceiveAsync(); if (_ct.IsCancellationRequested) { break; } if (_pt.IsPaused) { _pt.WaitWhilePausedWithResponseAsyc().Wait(); } trackedTasks.Add(DownloadPostAsync(downloadItem)); } } catch (OperationCanceledException e) { System.Diagnostics.Debug.WriteLine(e.ToString()); } await Task.WhenAll(trackedTasks); }
private async Task DownloadTextPostAsync(CrawlerData <XDocument> crawlerData) { string blogDownloadLocation = _blog.DownloadLocation(); string fileLocation = FileLocation(blogDownloadLocation, crawlerData.Filename); await AppendToTextFileAsync(fileLocation, crawlerData.Data); }
private void ToolStripMenuItem_Delete_Click(object sender, EventArgs e) { try { string strvalue = dataGridView_List.Rows[SelectedRowIndex_].Cells[SeqIndex_].Value.ToString(); CrawlerData pCrawlerData = CInfoManager.Instance.GetCrawlerData(Convert.ToInt32(strvalue)); string message = string.Format("선택된({0}) 크롤러 정보를 삭제 할까요?\n신중히 생각해 주세요.\n현재 동작중인 크롤러를 삭제 할경우 정상적인 동작이 보장되지 않습니다." , pCrawlerData.CrawlerName_); DialogResult dialogResult = MessageBox.Show(message, "확인", MessageBoxButtons.YesNo); if (dialogResult == DialogResult.Yes) { // 삭제 할하고 빼자 if (CMDBInterFace.DeleteCrawlerMonitorInfo(CInfoManager.Instance.DB(), pCrawlerData.seq_) == true) { Int32 MonitorSeq = pCrawlerData.seq_; CInfoManager.Instance.DelCrawlerData(MonitorSeq); if (RemoveRowByMonitorSeq(MonitorSeq) == true) { MessageBox.Show(string.Format("{0} 번 크롤러 모니터가 삭제 되었습니다.", MonitorSeq)); } } } } catch (System.Exception ex) { string message = string.Format("삭제중 문제가 생겼습니다.\n{0}", ex.Message); MessageBox.Show(message); } }
public void ChangeCrawlerMonitorInfo(CrawlerData pCrawlerData) { for (Int32 i = 0; i < dataGridView_List.Rows.Count; i++) { Int32 monitorseq = Convert.ToInt32(dataGridView_List.Rows[i].Cells[SeqIndex_].Value); if (monitorseq == pCrawlerData.seq_) { string id = ""; AuthorityInfoData pAuthorityInfoData = AuthorityManager.Instance.GetAuthrity(pCrawlerData.AuthoritySeq_); if (pAuthorityInfoData != null) { id = pAuthorityInfoData.partnerName_; } dataGridView_List.Rows[i].Cells[1].Value = string.Format("{0}:{1}", pCrawlerData.IP_, pCrawlerData.CrawlerSeq_); dataGridView_List.Rows[i].Cells[2].Value = pCrawlerData.CrawlerName_; dataGridView_List.Rows[i].Cells[3].Value = id; dataGridView_List.Rows[i].Cells[4].Value = pCrawlerData.ChannelName_; dataGridView_List.Rows[i].Cells[5].Value = string.Format("{0}", pCrawlerData.AuthorityLoginName_); dataGridView_List.Rows[i].Cells[6].Value = pCrawlerData.CrawlerState_; break; } } }
public void SettingCurInfo(CrawlerData pCrawlerData) { CrawlerData_ = pCrawlerData; AuthorityInfoData pAuthorityInfoData = AuthorityManager.Instance.GetAuthrity(pCrawlerData.AuthoritySeq_); if (pAuthorityInfoData != null) { comboBox_Authority.SelectedIndex = pAuthorityInfoData.ComboIndex_; } else { comboBox_Authority.SelectedIndex = 0; } Int32 nSeleIndex = 0; if (List_TempChannel_.Count > 0 && pCrawlerData.ChannelSeq_ > 0) { for (Int32 i = 0; i < List_TempChannel_.Count; i++) { if (List_TempChannel_[i].seq_ == pCrawlerData.ChannelSeq_) { nSeleIndex = i + 1; break; } } } comboBox_Channel.SelectedIndex = nSeleIndex; nSeleIndex = 0; if (List_TempAutoLogin_.Count > 0 && pCrawlerData.AuthorityLoginSeq_ > 0) { for (Int32 i = 0; i < List_TempAutoLogin_.Count; i++) { if (List_TempAutoLogin_[i].seq_ == pCrawlerData.AuthorityLoginSeq_) { nSeleIndex = i + 1; break; } } } comboBox_AuthLogin.SelectedIndex = nSeleIndex; textBox_CrawlerSeq.Text = pCrawlerData.CrawlerSeq_.ToString(); label_MonitorSeq.Text = pCrawlerData.seq_.ToString(); textBox_CrawlerName.Text = pCrawlerData.CrawlerName_; comboBox_CrawlerMode.SelectedIndex = pCrawlerData.Mode_; textBox_Memo.Text = pCrawlerData.Memo_; }
private async Task DownloadPostAsync(CrawlerData <XDocument> downloadItem) { try { await DownloadTextPostAsync(downloadItem); } catch { } }
public void SetInfo() { CrawlerData pCrawlerData = CInfoManager.Instance.GetCrawlerData(ManagerNavigation.Instance.Selected_Monitor_); List <string> listinfo = new List <string>(); listinfo.Add(string.Format("크롤러 IP : {0} {1}번", pCrawlerData.IP_, pCrawlerData.CrawlerSeq_)); listinfo.Add(string.Format("크롤러 동작방식 : {0}번 모드", pCrawlerData.Mode_)); listinfo.Add(string.Format("담당 채널 : {0}", pCrawlerData.ChannelName_)); listinfo.Add(string.Format("권리사 : {0}_{1}", pCrawlerData.AuthoritySeq_, pCrawlerData.AuthorityName_)); listinfo.Add(string.Format("관리자 메모 : {0}", pCrawlerData.Memo_)); richTextBox_Info.Lines = listinfo.ToArray(); }
private void ToolStripMenuItem_Edit_Click(object sender, EventArgs e) { string strvalue = dataGridView_List.Rows[SelectedRowIndex_].Cells[SeqIndex_].Value.ToString(); ManagerNavigation.Instance.Selected_Monitor_ = Convert.ToInt32(strvalue); CrawlerData pCrawlerData = CInfoManager.Instance.GetCrawlerData(ManagerNavigation.Instance.Selected_Monitor_); UpdateMonitorForm pUpdateMonitorForm = new UpdateMonitorForm(); pUpdateMonitorForm.MakeCombo(); pUpdateMonitorForm.SettingCurInfo(pCrawlerData); pUpdateMonitorForm.ShowDialog(this); }
public void Add_List(CrawlerData pCrawlerData) { DataGridViewRow r1 = new DataGridViewRow(); // 모니터 시퀀스 DataGridViewTextBoxCell cell_seq = new DataGridViewTextBoxCell(); cell_seq.Value = pCrawlerData.seq_; r1.Cells.Add(cell_seq); // 고유 번호( 아이피 와 크롤러 시퀀스 ) DataGridViewTextBoxCell cell_IP = new DataGridViewTextBoxCell(); cell_IP.Value = string.Format("{0}:{1}", pCrawlerData.IP_, pCrawlerData.CrawlerSeq_); r1.Cells.Add(cell_IP); // 크롤러 이름 DataGridViewTextBoxCell cell_CName = new DataGridViewTextBoxCell(); cell_CName.Value = pCrawlerData.CrawlerName_; r1.Cells.Add(cell_CName); // 권리사 string id = ""; AuthorityInfoData pAuthorityInfoData = AuthorityManager.Instance.GetAuthrity(pCrawlerData.AuthoritySeq_); if (pAuthorityInfoData != null) id = pAuthorityInfoData.partnerName_; DataGridViewTextBoxCell cell_auth = new DataGridViewTextBoxCell(); cell_auth.Value = id; r1.Cells.Add(cell_auth); // 채널 DataGridViewTextBoxCell cell_channel = new DataGridViewTextBoxCell(); cell_channel.Value = pCrawlerData.ChannelName_; r1.Cells.Add(cell_channel); // 권리사 로그인 DataGridViewTextBoxCell cell_authlogin = new DataGridViewTextBoxCell(); cell_authlogin.Value = string.Format("{0}", pCrawlerData.AuthorityLoginName_); r1.Cells.Add(cell_authlogin); // 상태 DataGridViewTextBoxCell cell_state = new DataGridViewTextBoxCell(); cell_state.Value = pCrawlerData.CrawlerState_; r1.Cells.Add(cell_state); // 최근 변경 시간 DataGridViewTextBoxCell cell_update = new DataGridViewTextBoxCell(); cell_update.Value = pCrawlerData.UpdateDate_; r1.Cells.Add(cell_update); dataGridView_List.Rows.Add(r1); }
public void RefreshList() { CrawlerData pCrawlerData = CInfoManager.Instance.GetCrawlerData(ManagerNavigation.Instance.Selected_Monitor_); dataGridView_GoodsList.Rows.Clear(); Dictionary <Int32, CGoodsData> OutList = new Dictionary <Int32, CGoodsData>(); Int32 nCount = GoodsManager.Instance.GetListByCrawerSeq(pCrawlerData.CrawlerSeq_, ref OutList); foreach (var pData in OutList) { AddToList(pData.Value); } }
public void SettingCurInfo(CrawlerData pCrawlerData) { CrawlerData_ = pCrawlerData; AuthorityInfoData pAuthorityInfoData = AuthorityManager.Instance.GetAuthrity(pCrawlerData.AuthoritySeq_); if (pAuthorityInfoData != null) comboBox_Authority.SelectedIndex = pAuthorityInfoData.ComboIndex_; else comboBox_Authority.SelectedIndex = 0; Int32 nSeleIndex = 0; if (List_TempChannel_.Count > 0 && pCrawlerData.ChannelSeq_ > 0) { for (Int32 i = 0; i < List_TempChannel_.Count; i++ ) { if (List_TempChannel_[i].seq_ == pCrawlerData.ChannelSeq_) { nSeleIndex = i + 1; break; } } } comboBox_Channel.SelectedIndex = nSeleIndex; nSeleIndex = 0; if (List_TempAutoLogin_.Count > 0 && pCrawlerData.AuthorityLoginSeq_ > 0) { for (Int32 i = 0; i < List_TempAutoLogin_.Count; i++) { if (List_TempAutoLogin_[i].seq_ == pCrawlerData.AuthorityLoginSeq_) { nSeleIndex = i + 1; break; } } } comboBox_AuthLogin.SelectedIndex = nSeleIndex; textBox_CrawlerSeq.Text = pCrawlerData.CrawlerSeq_.ToString(); label_MonitorSeq.Text = pCrawlerData.seq_.ToString(); textBox_CrawlerName.Text = pCrawlerData.CrawlerName_; comboBox_CrawlerMode.SelectedIndex = pCrawlerData.Mode_; textBox_Memo.Text = pCrawlerData.Memo_; }
private void AddToJsonQueue(CrawlerData <Post> addToList) { if (!Blog.DumpCrawlerData) { return; } lock (existingCrawlerDataLock) { if (Blog.ForceRescan || !existingCrawlerData.Contains(addToList.Filename)) { jsonQueue.Add(addToList); existingCrawlerData.Add(addToList.Filename); } } }
// 크롤링 정보 로드 public static bool GetAllCrawlerMonitor(SqlHelper dbHelper) { try { CInfoManager.Instance.InitList(); MySqlDataReader datareader = dbHelper.call_proc("spNewSelectCrawlerMonitor", null); while (datareader.Read()) { CrawlerData pCrawlerData = new CrawlerData(); if (datareader["seq"] != null) { pCrawlerData.seq_ = Convert.ToInt32(datareader["seq"]); } if (datareader["CrawlerName"] != null && datareader["CrawlerName"] != DBNull.Value) { pCrawlerData.CrawlerName_ = Convert.ToString(datareader["CrawlerName"]); } if (datareader["ChannelSeq"] != null && datareader["ChannelSeq"] != DBNull.Value) { pCrawlerData.ChannelSeq_ = Convert.ToInt32(datareader["ChannelSeq"]); } if (datareader["ChannelName"] != null && datareader["ChannelName"] != DBNull.Value) { pCrawlerData.ChannelName_ = Convert.ToString(datareader["ChannelName"]); } if (datareader["AuthoritySeq"] != null && datareader["AuthoritySeq"] != DBNull.Value) { pCrawlerData.AuthoritySeq_ = Convert.ToInt32(datareader["AuthoritySeq"]); } if (datareader["AuthorityName"] != null && datareader["AuthorityName"] != DBNull.Value) { pCrawlerData.AuthorityName_ = Convert.ToString(datareader["AuthorityName"]); } if (datareader["AuthorityLoginSeq"] != null && datareader["AuthorityLoginSeq"] != DBNull.Value) { pCrawlerData.AuthorityLoginSeq_ = Convert.ToInt32(datareader["AuthorityLoginSeq"]); } if (datareader["AuthorityLoginName"] != null && datareader["AuthorityLoginName"] != DBNull.Value) { pCrawlerData.AuthorityLoginName_ = Convert.ToString(datareader["AuthorityLoginName"]); } if (datareader["CrawlerSeq"] != null && datareader["CrawlerSeq"] != DBNull.Value) { pCrawlerData.CrawlerSeq_ = Convert.ToInt32(datareader["CrawlerSeq"]); } if (datareader["Mode"] != null && datareader["Mode"] != DBNull.Value) { pCrawlerData.Mode_ = Convert.ToInt32(datareader["Mode"]); } if (datareader["Memo"] != null && datareader["Memo"] != DBNull.Value) { pCrawlerData.Memo_ = Convert.ToString(datareader["Memo"]); } if (datareader["IP"] != null && datareader["IP"] != DBNull.Value) { pCrawlerData.IP_ = Convert.ToString(datareader["IP"]); } if (datareader["CrawlerState"] != null && datareader["CrawlerState"] != DBNull.Value) { pCrawlerData.CrawlerState_ = Convert.ToString(datareader["CrawlerState"]); } if (datareader["UpdateDate"] != null && datareader["UpdateDate"] != DBNull.Value) { pCrawlerData.UpdateDate_ = Convert.ToString(datareader["UpdateDate"]); } CInfoManager.Instance.GetList().Add(pCrawlerData.seq_, pCrawlerData); } datareader.Close(); datareader.Dispose(); datareader = null; } catch (System.Exception ex) { return(false); } return(true); }
private void button_Confirm_Click(object sender, EventArgs e) { bool bChanged = false; MainForm pMainForm = (MainForm)this.Owner; if (comboBox_Authority.SelectedIndex == 0) { MessageBox.Show("권리사를 선택하세요"); return; } if (comboBox_Channel.SelectedIndex == 0 || List_TempChannel_.Count == 0) { MessageBox.Show("채널을 선택하세요"); return; } if (comboBox_AuthLogin.SelectedIndex == 0 || List_TempAutoLogin_.Count == 0) { MessageBox.Show("권리사 로그인을 선택하세요"); return; } if (comboBox_CrawlerMode.SelectedIndex == 0) { MessageBox.Show("모드를 선택하세요"); return; } Int32 xMonitorSeq = Convert.ToInt32(label_MonitorSeq.Text); string xCrawlerName = textBox_CrawlerName.Text; TempChannel pTempChannel = List_TempChannel_[comboBox_Channel.SelectedIndex - 1]; //ChannelInfoData pChannelInfoData = ChannelManager.Instance.GetChannelByComboBoxIndex(comboBox_Channel.SelectedIndex); Int32 xChannelSeq = pTempChannel.seq_; string xChannelName = pTempChannel.ChannelName_; TempAutoLogin pTempAutoLogin = List_TempAutoLogin_[comboBox_AuthLogin.SelectedIndex - 1]; Int32 xAuthLoginSeq = pTempAutoLogin.seq_; string xAuthLoginName = pTempAutoLogin.Name_; AuthorityInfoData pAuthorityInfoData = AuthorityManager.Instance.GetAuthrityByComboBoxIndex(comboBox_Authority.SelectedIndex); Int32 xAuthoritySeq = pAuthorityInfoData.seq_; string xAuthorityName = pAuthorityInfoData.partnerName_; Int32 xCrawlerSeq = 0; try { xCrawlerSeq = Convert.ToInt32(textBox_CrawlerSeq.Text); } catch (System.Exception ex) { xCrawlerSeq = 0; } if (xCrawlerSeq == 0) { MessageBox.Show("크롤러 시퀀스 값이 이상합니다."); return; } Int32 xMode = comboBox_CrawlerMode.SelectedIndex; string xCrawler_OnOff = ""; string xCrawler_location = ""; Int32 xCrawlerCheckTime = 0; Int32 xDBUpdateTime = 0; string xMemo = textBox_Memo.Text; if (xCrawlerName != CrawlerData_.CrawlerName_ || xCrawlerSeq != CrawlerData_.CrawlerSeq_ || xChannelSeq != CrawlerData_.ChannelSeq_ || xAuthoritySeq != CrawlerData_.AuthoritySeq_ || xMode != CrawlerData_.Mode_ || xMemo != CrawlerData_.Memo_ || xAuthLoginSeq != CrawlerData_.AuthorityLoginSeq_) { bChanged = CMDBInterFace.UpdateCrawlerMonitorInfo(CInfoManager.Instance.DB(), xMonitorSeq, xCrawlerName, xChannelSeq, xChannelName , xAuthoritySeq, xAuthorityName, xCrawlerSeq, xMode, xCrawler_OnOff, xCrawler_location, xCrawlerCheckTime, xDBUpdateTime , xMemo, xAuthLoginSeq, xAuthLoginName); if (bChanged == true) { CrawlerData_.CrawlerName_ = xCrawlerName; CrawlerData_.CrawlerSeq_ = xCrawlerSeq; CrawlerData_.ChannelSeq_ = xChannelSeq; CrawlerData_.ChannelName_ = xChannelName; CrawlerData_.AuthoritySeq_ = xAuthoritySeq; CrawlerData_.AuthorityLoginSeq_ = xAuthLoginSeq; CrawlerData_.AuthorityLoginName_ = xAuthLoginName; CrawlerData_.Mode_ = xMode; CrawlerData_.Memo_ = xMemo; pMainForm.ChangeCrawlerMonitorInfo(CrawlerData_); } } CrawlerData_ = null; Close(); if (bChanged == true) { MessageBox.Show("변경 완료 되었습니다."); } }
private void button_Confirm_Click(object sender, EventArgs e) { bool bChanged = false; MainForm pMainForm = (MainForm)this.Owner; if (comboBox_Authority.SelectedIndex == 0) { MessageBox.Show("권리사를 선택하세요"); return; } if (comboBox_Channel.SelectedIndex == 0 || List_TempChannel_.Count == 0) { MessageBox.Show("채널을 선택하세요"); return; } if (comboBox_AuthLogin.SelectedIndex == 0 || List_TempAutoLogin_.Count == 0) { MessageBox.Show("권리사 로그인을 선택하세요"); return; } if (comboBox_CrawlerMode.SelectedIndex == 0) { MessageBox.Show("모드를 선택하세요"); return; } Int32 xMonitorSeq = Convert.ToInt32(label_MonitorSeq.Text); string xCrawlerName = textBox_CrawlerName.Text; TempChannel pTempChannel = List_TempChannel_[comboBox_Channel.SelectedIndex-1]; //ChannelInfoData pChannelInfoData = ChannelManager.Instance.GetChannelByComboBoxIndex(comboBox_Channel.SelectedIndex); Int32 xChannelSeq = pTempChannel.seq_; string xChannelName = pTempChannel.ChannelName_; TempAutoLogin pTempAutoLogin = List_TempAutoLogin_[comboBox_AuthLogin.SelectedIndex - 1]; Int32 xAuthLoginSeq = pTempAutoLogin.seq_; string xAuthLoginName = pTempAutoLogin.Name_; AuthorityInfoData pAuthorityInfoData = AuthorityManager.Instance.GetAuthrityByComboBoxIndex(comboBox_Authority.SelectedIndex); Int32 xAuthoritySeq = pAuthorityInfoData.seq_; string xAuthorityName = pAuthorityInfoData.partnerName_; Int32 xCrawlerSeq = 0; try { xCrawlerSeq = Convert.ToInt32(textBox_CrawlerSeq.Text); } catch (System.Exception ex) { xCrawlerSeq = 0; } if (xCrawlerSeq == 0) { MessageBox.Show("크롤러 시퀀스 값이 이상합니다."); return; } Int32 xMode = comboBox_CrawlerMode.SelectedIndex; string xCrawler_OnOff = ""; string xCrawler_location = ""; Int32 xCrawlerCheckTime = 0; Int32 xDBUpdateTime = 0; string xMemo = textBox_Memo.Text; if (xCrawlerName != CrawlerData_.CrawlerName_ || xCrawlerSeq != CrawlerData_.CrawlerSeq_ || xChannelSeq != CrawlerData_.ChannelSeq_ || xAuthoritySeq != CrawlerData_.AuthoritySeq_ || xMode != CrawlerData_.Mode_ || xMemo != CrawlerData_.Memo_ || xAuthLoginSeq != CrawlerData_.AuthorityLoginSeq_) { bChanged = CMDBInterFace.UpdateCrawlerMonitorInfo(CInfoManager.Instance.DB(), xMonitorSeq, xCrawlerName, xChannelSeq, xChannelName , xAuthoritySeq, xAuthorityName, xCrawlerSeq, xMode, xCrawler_OnOff, xCrawler_location, xCrawlerCheckTime, xDBUpdateTime , xMemo, xAuthLoginSeq, xAuthLoginName); if (bChanged == true) { CrawlerData_.CrawlerName_ = xCrawlerName; CrawlerData_.CrawlerSeq_ = xCrawlerSeq; CrawlerData_.ChannelSeq_ = xChannelSeq; CrawlerData_.ChannelName_ = xChannelName; CrawlerData_.AuthoritySeq_ = xAuthoritySeq; CrawlerData_.AuthorityLoginSeq_ = xAuthLoginSeq; CrawlerData_.AuthorityLoginName_ = xAuthLoginName; CrawlerData_.Mode_ = xMode; CrawlerData_.Memo_ = xMemo; pMainForm.ChangeCrawlerMonitorInfo(CrawlerData_); } } CrawlerData_ = null; Close(); if (bChanged == true) MessageBox.Show("변경 완료 되었습니다."); }
public void Add_List(CrawlerData pCrawlerData) { DataGridViewRow r1 = new DataGridViewRow(); // 모니터 시퀀스 DataGridViewTextBoxCell cell_seq = new DataGridViewTextBoxCell(); cell_seq.Value = pCrawlerData.seq_; r1.Cells.Add(cell_seq); // 고유 번호( 아이피 와 크롤러 시퀀스 ) DataGridViewTextBoxCell cell_IP = new DataGridViewTextBoxCell(); cell_IP.Value = string.Format("{0}:{1}", pCrawlerData.IP_, pCrawlerData.CrawlerSeq_); r1.Cells.Add(cell_IP); // 크롤러 이름 DataGridViewTextBoxCell cell_CName = new DataGridViewTextBoxCell(); cell_CName.Value = pCrawlerData.CrawlerName_; r1.Cells.Add(cell_CName); // 권리사 string id = ""; AuthorityInfoData pAuthorityInfoData = AuthorityManager.Instance.GetAuthrity(pCrawlerData.AuthoritySeq_); if (pAuthorityInfoData != null) { id = pAuthorityInfoData.partnerName_; } DataGridViewTextBoxCell cell_auth = new DataGridViewTextBoxCell(); cell_auth.Value = id; r1.Cells.Add(cell_auth); // 채널 DataGridViewTextBoxCell cell_channel = new DataGridViewTextBoxCell(); cell_channel.Value = pCrawlerData.ChannelName_; r1.Cells.Add(cell_channel); // 권리사 로그인 DataGridViewTextBoxCell cell_authlogin = new DataGridViewTextBoxCell(); cell_authlogin.Value = string.Format("{0}", pCrawlerData.AuthorityLoginName_); r1.Cells.Add(cell_authlogin); // 상태 DataGridViewTextBoxCell cell_state = new DataGridViewTextBoxCell(); cell_state.Value = pCrawlerData.CrawlerState_; r1.Cells.Add(cell_state); // 최근 변경 시간 DataGridViewTextBoxCell cell_update = new DataGridViewTextBoxCell(); cell_update.Value = pCrawlerData.UpdateDate_; r1.Cells.Add(cell_update); dataGridView_List.Rows.Add(r1); }
public void ChangeCrawlerMonitorInfo(CrawlerData pCrawlerData) { for (Int32 i = 0; i < dataGridView_List.Rows.Count; i++) { Int32 monitorseq = Convert.ToInt32(dataGridView_List.Rows[i].Cells[SeqIndex_].Value); if (monitorseq == pCrawlerData.seq_) { string id = ""; AuthorityInfoData pAuthorityInfoData = AuthorityManager.Instance.GetAuthrity(pCrawlerData.AuthoritySeq_); if (pAuthorityInfoData != null) id = pAuthorityInfoData.partnerName_; dataGridView_List.Rows[i].Cells[1].Value = string.Format("{0}:{1}", pCrawlerData.IP_, pCrawlerData.CrawlerSeq_); dataGridView_List.Rows[i].Cells[2].Value = pCrawlerData.CrawlerName_; dataGridView_List.Rows[i].Cells[3].Value = id; dataGridView_List.Rows[i].Cells[4].Value = pCrawlerData.ChannelName_; dataGridView_List.Rows[i].Cells[5].Value = string.Format("{0}", pCrawlerData.AuthorityLoginName_); dataGridView_List.Rows[i].Cells[6].Value = pCrawlerData.CrawlerState_; break; } } }
public void ChangeCrawlerMonitorInfo(CrawlerData pCrawlerData) { CrawlerStateForm_.ChangeCrawlerMonitorInfo(pCrawlerData); }
// 크롤링 정보 로드 public static bool GetAllCrawlerMonitor(SqlHelper dbHelper) { try { CInfoManager.Instance.InitList(); MySqlDataReader datareader = dbHelper.call_proc("spNewSelectCrawlerMonitor", null); while (datareader.Read()) { CrawlerData pCrawlerData = new CrawlerData(); if (datareader["seq"] != null) pCrawlerData.seq_ = Convert.ToInt32(datareader["seq"]); if (datareader["CrawlerName"] != null && datareader["CrawlerName"] != DBNull.Value) pCrawlerData.CrawlerName_ = Convert.ToString(datareader["CrawlerName"]); if (datareader["ChannelSeq"] != null && datareader["ChannelSeq"] != DBNull.Value) pCrawlerData.ChannelSeq_ = Convert.ToInt32(datareader["ChannelSeq"]); if (datareader["ChannelName"] != null && datareader["ChannelName"] != DBNull.Value) pCrawlerData.ChannelName_ = Convert.ToString(datareader["ChannelName"]); if (datareader["AuthoritySeq"] != null && datareader["AuthoritySeq"] != DBNull.Value) pCrawlerData.AuthoritySeq_ = Convert.ToInt32(datareader["AuthoritySeq"]); if (datareader["AuthorityName"] != null && datareader["AuthorityName"] != DBNull.Value) pCrawlerData.AuthorityName_ = Convert.ToString(datareader["AuthorityName"]); if (datareader["AuthorityLoginSeq"] != null && datareader["AuthorityLoginSeq"] != DBNull.Value) pCrawlerData.AuthorityLoginSeq_ = Convert.ToInt32(datareader["AuthorityLoginSeq"]); if (datareader["AuthorityLoginName"] != null && datareader["AuthorityLoginName"] != DBNull.Value) pCrawlerData.AuthorityLoginName_ = Convert.ToString(datareader["AuthorityLoginName"]); if (datareader["CrawlerSeq"] != null && datareader["CrawlerSeq"] != DBNull.Value) pCrawlerData.CrawlerSeq_ = Convert.ToInt32(datareader["CrawlerSeq"]); if (datareader["Mode"] != null && datareader["Mode"] != DBNull.Value) pCrawlerData.Mode_ = Convert.ToInt32(datareader["Mode"]); if (datareader["Memo"] != null && datareader["Memo"] != DBNull.Value) pCrawlerData.Memo_ = Convert.ToString(datareader["Memo"]); if (datareader["IP"] != null && datareader["IP"] != DBNull.Value) pCrawlerData.IP_ = Convert.ToString(datareader["IP"]); if (datareader["CrawlerState"] != null && datareader["CrawlerState"] != DBNull.Value) pCrawlerData.CrawlerState_ = Convert.ToString(datareader["CrawlerState"]); if (datareader["UpdateDate"] != null && datareader["UpdateDate"] != DBNull.Value) pCrawlerData.UpdateDate_ = Convert.ToString(datareader["UpdateDate"]); CInfoManager.Instance.GetList().Add(pCrawlerData.seq_, pCrawlerData); } datareader.Close(); datareader.Dispose(); datareader = null; } catch (System.Exception ex) { return false; } return true; }