精通
英语
和
开源
,
擅长
开发
与
培训
,
胸怀四海
第一信赖
i am a green man ,I admire you article. but i got a problem, altoughte you are list all source code ,but i spend A lot of time to read you article .we can't know the one page including how munch hyperlink,how i can distribute hyperlink number to the muilty-threadingor another solution. 我是一个绿色的人,我佩服你。 但是我有一个问题,尽管你列出所有源代码, 但是我花了很多时间去读你的文章。我们不能知道一个页面包括多少超链接,我怎样才能让超链接个数发送到其它多个线程里或另一个解决方案。
Sir,先生,I afraid I can't help u, as I forgot all things related to the article. I left C# from 5 years.But, I'll try. 我怕我帮不了你,因为我忘记了一切相关的文章。 我离开了c# 5年。但是,我会努力。
Suppose that the thread which parses any page put found URLs in a URL server, and each URL take a serial ID. So, if we have a thread manager that control which thread should take which URL.假设线程解析任何页面将发现URL,并且每个URL有个系列ID。所以,如果我们有一个线程管理器控制哪些线程应该采用哪些URL。
If you have N thread, and assume that URL number now is m so we can choose the suitable thread like that: 如果你有N个线程,假设URL数量现在是m这样我们可以选择合适的线程:
nThreadIndex = m % N;
So, can do a load balancing, as first N URLs with be distributed for all threads 可以做负载均衡,作为第N url所有线程的分配
Tell me if that is the answer of ur question.thanks 告诉我如果这是你的问题的答案,谢谢 !
Have you got an alternative suggestion? 你有另一个建议吗 ?
Simply create a delegate that handles the log. Using a if (obj.InvokeRequired == True) allows you to access the objects. Below is a simple text example.简单地创建一个委托处理日志。 使用if(obj。 InvokeRequired = = True)允许您访问的对象。 下面是一个简单的文本的例子
private delegate void UpdateTextDelegate(string txt);
public void addStatusMessage(string statusMessage)
{
if (this.rtbStatus.InvokeRequired)
{
this.BeginInvoke(new UpdateTextDelegate(addStatusMessage), new object[] { statusMessage });
}
else
{
rtbStatus.AppendText(DateTime.Now.ToString() + " - " + statusMessage + "\r");
HideCaret(rtbStatus.Handle);
}
}
greate .it helpfull to me 太棒了,它能帮助我