delegate bool AsyncXpathqueryCaller(string xmlfile bool found = false; AsyncXpathqueryCaller asyncXpath = new AsyncXpathqueryCaller(Createdocument); IAsyncResult result = asyncXpath.BeginInvoke(xmlfile,null,null); while (!result.IsCompleted) { result.AsyncWaitHandle.WaitOne(100,false); } found = asyncXpath.EndInvoke(result);private bool Createdocument (string xmlfile){XPathdocument doc = new XPathdocument(xmlfile);}解决方法 在尝试加载和检查大小之前使用 FileInfo怎么样?如果它太大就跳过它.
像这样的东西:
fileInfo fi = new fileInfo(xmlfile);if(fi.Length < /*some huge number*/){ //load the file}总结
以上是内存溢出为你收集整理的c# – 如何停止“黑匣子” *** 作?全部内容,希望文章能够帮你解决c# – 如何停止“黑匣子” *** 作?所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)