使用XmlDocument读取html文件时遇到问题。项目是C#Windows Forms,VS2012
{"错误服务器remoto:(500)错误interno del servidor。"}
远程服务器出错:(500)服务器内部错误![]()
我将页面保存为html
我可以在浏览器中重新打开页面确定
我也可以使用File.ReadAllText阅读它,因此不具备安全性。
我尝试加载test.html <html><b>HELLO WORLD</b></html>
并加载确定。
所以我的猜测就是浏览器中的另存为损坏了文件?
有没有办法进行部分加载或检查导致错误的部分?
string curFile = @"C:\Uti\CambiaImagen.html";
if (File.Exists(curFile)) {
string html = File.ReadAllText(curFile);
//XmlDocument xd = new XmlDocument();
//xd.Load(curFile);
}