在 System.InvalidOperationException 中第一次偶然出现的“mscorlib.dll”类型的异常请问这是什么原因啊? #region URL入队列
// push uri to the queue
bool EnqueueUri(MyUri uri, bool bCheckRepetition)
{
// add the uri to the binary tree to check if it is duplicated or not
if (bCheckRepetition == true && AddURL(ref uri) == false)
return false; Common comm = new Common();
if (!(comm.ChoseJobUri(ref uri, "//JobWeb")))
return false; Monitor.Enter(queueURLS);
try
{
// add the uri to the queue
queueURLS.Enqueue(uri);
}
catch (Exception)
{
}
Monitor.Exit(queueURLS); return true;
}
#endregion我就在上面代码内加了一段代码:Common comm = new Common();
if (!(comm.ChoseJobUri(ref uri, "//JobWeb")))
return false;
请大年们帮忙,谢谢!
// push uri to the queue
bool EnqueueUri(MyUri uri, bool bCheckRepetition)
{
// add the uri to the binary tree to check if it is duplicated or not
if (bCheckRepetition == true && AddURL(ref uri) == false)
return false; Common comm = new Common();
if (!(comm.ChoseJobUri(ref uri, "//JobWeb")))
return false; Monitor.Enter(queueURLS);
try
{
// add the uri to the queue
queueURLS.Enqueue(uri);
}
catch (Exception)
{
}
Monitor.Exit(queueURLS); return true;
}
#endregion我就在上面代码内加了一段代码:Common comm = new Common();
if (!(comm.ChoseJobUri(ref uri, "//JobWeb")))
return false;
请大年们帮忙,谢谢!
解决方案 »
- C#下移除窗口的代码,求详细解释
- 无法将文件“E:\学校教务管理系统\MySchool\Data\DBSchool.mdf”复制到“bin\Release\Data\DBSchool.mdf”。文件“E:\学校教务管理系统\
- 普通窗体模仿MDI窗体工作。
- ■■■bindingNavigator 绑定 控件的问题。
- WMP做播放器
- 菜鸟又来请教~
- 100分求一"提取WEB数据入库" C#的例子
- 為什麼 我的ds.Tables.Count 老是為0? DataGrid 也能顯示數據!
- 怎样禁止复制、粘贴?做一个远程教育用的东西,为了防止学生提交作业时互相COPY,需要禁止复制、粘贴功能
- 请问这种方式的连接效果在Winform里怎么实现?
- C#新手请教 C#如何传递字体颜色之类
- 用c#获取系统参数
public bool ChoseJobUri(ref MyUri uri, string xpath)
{
bool btn = false;
XmlHelper xmlHelper = new XmlHelper();
XmlNode node = xmlHelper.GetNode("EncodingType.xml", xpath);
switch (uri.Host)
{
case "www.tianjihr.com":
string url = node.ChildNodes[5].InnerText;
string param = node.ChildNodes[3].InnerText;
uri = new MyUri(url + param);//返回的URI
Hashtable ht = new Hashtable();
ht.Add("param", int.Parse(param) + 1);
xmlHelper.UpdateNode("EncodingType.xml", "Web", null, ht);//更新参数值
btn = true;
break;
default:
break;
}
return btn;
}谢谢
switch (uri.Host)
{
case "www.tianjihr.com":
string url = node.ChildNodes[5].InnerText;
string param = node.ChildNodes[3].InnerText;
uri = new MyUri(url + param);//返回的URI
Hashtable ht = new Hashtable();
ht.Add("param", int.Parse(param) + 1);
xmlHelper.UpdateNode("EncodingType.xml", "Web", null, ht);//更新参数值
btn = true;
break;
default:
break;
}
就提示:由于以前的函数求值超时,函数求值被禁用。必须继续执行才能重新启用函数求值。
public XmlNode GetNode(string XmlFile, string nodePath)
{
XmlDocument xml = new XmlDocument();
xml.Load(XmlFile);
XmlNode xmlNode = xml.DocumentElement.SelectSingleNode(nodePath);
return xmlNode;
}我感觉这没有啥问题