private void PostTopic() { while (dtTableUp.Rows.Count > 0) { if (isAbort == false) { if (isLock == false) { if (dtTableUp.Rows.Count > 0) { try { string strErr = ""; long id = -1; WebLink weblink = null; lock (this) { isLock = true; id = long.Parse(dtTableUp.Rows[0]["ID"].ToString()); dtTableUp.Rows.RemoveAt(0); weblink = WebLink.Get(id); isLock = false; } StatusObj statusObj = new StatusObj(); if (weblink != null) { strErr = "Up page " + weblink.Url + " [ " + weblink.Topic + " ] " + "...................."; DataRow dtRow = dtLogEntries.NewRow(); dtRow["ID"] = id; dtRow["LogEntries"] = strErr; dtRow["DateTime"] = DateTime.Now.ToString("dd/MM/yyyy HH:mm:ss"); dtLogEntries.Rows.Add(dtRow); try { WebBrowser webBrowser = (WebBrowser)panelControl1.Controls[id.ToString()]; WorkLibrary.AutoUp post = new WorkLibrary.AutoUp(webBrowser, weblink, Content); statusObj = post.UpTopicForum(); strErr = strErr + statusObj.Message; try { webBrowser.Dispose(); } catch { } try { panelControl1.Controls.Remove(webBrowser); } catch { } } catch { strErr = strErr + " Error."; } dtRow["LogEntries"] = strErr; dtRow["LinkUp"] = statusObj.Value; dtRow["Status"] = statusObj.Status; } } catch { isLock = false; } } } } } }
private void PostTopic() { while (dtTableUp.Rows.Count > 0) { if (isAbort == false) { if (isLock == false) { if (dtTableUp.Rows.Count > 0) { try { string strErr = ""; long id = -1; WebLink weblink = null; lock (this) { isLock = true; id = long.Parse(dtTableUp.Rows[0]["ID"].ToString()); dtTableUp.Rows.RemoveAt(0); weblink = WebLink.Get(id); isLock = false; } StatusObj statusObj = new StatusObj(); if (weblink != null) { strErr = "Up page " + weblink.Url + " [ " + weblink.Topic + " ] " + "...................."; DataRow dtRow = dtLogEntries.NewRow(); dtRow["ID"] = id; dtRow["LogEntries"] = strErr; dtRow["DateTime"] = DateTime.Now.ToString("dd/MM/yyyy HH:mm:ss"); dtLogEntries.Rows.Add(dtRow); try { WebBrowser webBrowser = (WebBrowser)panelControl1.Controls[id.ToString()]; WorkLibrary.AutoUp post = new WorkLibrary.AutoUp(webBrowser, weblink); statusObj = post.UpTopicWeb(); strErr = strErr + statusObj.Message; try { webBrowser.Dispose(); } catch { } try { panelControl1.Controls.Remove(webBrowser); } catch { } } catch { strErr = strErr + " Error."; } dtRow["LogEntries"] = strErr; dtRow["LinkUp"] = statusObj.Value; dtRow["Status"] = statusObj.Status; } } catch { isLock = false; } } } } } }