HttpWebRequest 和 HttpWebResponse 错误

发布于 2024-09-24 22:02:23 字数 2661 浏览 3 评论 0原文

我正在尝试运行在此页面。
一切都很好,我在几个网站上尝试了该程序,它工作正常,但有一个网站不是返回其页面中的 html 内容,而是生成一个 srtange 错误:

DotNetNuke Error: - Version 04.05.01 Return to main page

并且返回的 html 是:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang="en-US">
<head>
    <title id="Title">Error</title>
    <link id="StyleSheet" href="/Install/Install.css" type="text/css" rel="stylesheet"></link>
</head>
<body>
    <form name="Form" method="post" action="ErrorPage.aspx?tabid=186&amp;error=Object+reference+not+set+to+an+instance+of+an+object.&amp;content=0&amp;language=ar-SY" id="Form">
<input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="/wEPDwUJNTkzNjY2ODU2D2QWBAIDDxYCHgRocmVmBRQvSW5zdGFsbC9JbnN0YWxsLmNzc2QCBQ9kFgICAg8PFgIeBFRleHQFRDxpbWcgc3JjPSIvaW1hZ2VzL2x0LmdpZiIgYm9yZGVyPSIwIiAvPiDYsdis2YjYuSDYp9mE2Ykg2KfZhNmF2YjZgti5ZGRk2aDp+vZbUIDHSd3beGBaLQrJ6yk=" />

        <table cellspacing="5" cellpadding="5" border="0" class="Error">
            <tr>
                <td><img id="Image1" src="logo.gif" alt="DotNetNuke" border="0" /></td>
            </tr>
            <tr style="height:100%;">
                <td valign="top" style="width:650px;">
                    <h2>DotNetNuke Error: - Version 04.05.01</h2>
                    <hr />
                    <p>
<table border="0" cellspacing="0" cellpadding="4">
    <tr>
        <td valign="top" align="left"><img id="ctl00_imgIcon" src="images/red-error.gif" border="0" /></td>
        <td valign="middle" align="left"><span id="ctl00_lblHeading" class="NormalRed">an error has been occurred<br/></span><span id="ctl00_lblMessage" class="Normal">return to the site.</span></td>
    </tr>
</table>
<hr noshade size="1"/></p>
                </td>
            </tr>
            <tr>
                <td align="right"><a id="hypReturn" class="WizardButton" href="Default.aspx"><img src="/images/lt.gif" border="0" /> return to the site</a></td>
            </tr>
            <tr><td height="10px"></td></tr>
        </table>
    </form>
</body>
</html>

那么什么是 DotNetNuke 错误问题是什么...顺便说一句,错误发生在一个阿拉伯网站上,我在另一个阿拉伯网站上尝试过,没有错误。

I am trying to run a simple code for web crawler written in this page .
every thing is fine and I tried the program on several sites and it works fine but there is one site instead of returning the html content in its pages it generates a srtange error :

DotNetNuke Error: - Version 04.05.01 Return to main page

and the html returned is :

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang="en-US">
<head>
    <title id="Title">Error</title>
    <link id="StyleSheet" href="/Install/Install.css" type="text/css" rel="stylesheet"></link>
</head>
<body>
    <form name="Form" method="post" action="ErrorPage.aspx?tabid=186&error=Object+reference+not+set+to+an+instance+of+an+object.&content=0&language=ar-SY" id="Form">
<input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="/wEPDwUJNTkzNjY2ODU2D2QWBAIDDxYCHgRocmVmBRQvSW5zdGFsbC9JbnN0YWxsLmNzc2QCBQ9kFgICAg8PFgIeBFRleHQFRDxpbWcgc3JjPSIvaW1hZ2VzL2x0LmdpZiIgYm9yZGVyPSIwIiAvPiDYsdis2YjYuSDYp9mE2Ykg2KfZhNmF2YjZgti5ZGRk2aDp+vZbUIDHSd3beGBaLQrJ6yk=" />

        <table cellspacing="5" cellpadding="5" border="0" class="Error">
            <tr>
                <td><img id="Image1" src="logo.gif" alt="DotNetNuke" border="0" /></td>
            </tr>
            <tr style="height:100%;">
                <td valign="top" style="width:650px;">
                    <h2>DotNetNuke Error: - Version 04.05.01</h2>
                    <hr />
                    <p>
<table border="0" cellspacing="0" cellpadding="4">
    <tr>
        <td valign="top" align="left"><img id="ctl00_imgIcon" src="images/red-error.gif" border="0" /></td>
        <td valign="middle" align="left"><span id="ctl00_lblHeading" class="NormalRed">an error has been occurred<br/></span><span id="ctl00_lblMessage" class="Normal">return to the site.</span></td>
    </tr>
</table>
<hr noshade size="1"/></p>
                </td>
            </tr>
            <tr>
                <td align="right"><a id="hypReturn" class="WizardButton" href="Default.aspx"><img src="/images/lt.gif" border="0" /> return to the site</a></td>
            </tr>
            <tr><td height="10px"></td></tr>
        </table>
    </form>
</body>
</html>

so what is DotNetNuke Error and what is the problem...BTW the error occurred in an Arabian site and I tried on another Arabian sites and there were no errors.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

上课铃就是安魂曲 2024-10-01 22:02:23

您的爬网程序似乎已生成导致 DotNetNuke 崩溃的请求。您可能正在请求一个不存在的页面或传递导致 DotNetNuke 崩溃的请求参数。

只需将此结果视为失败的请求即可。

It seems that your crawler has generated a request that caused DotNetNuke to crash. You probably are requesting a page that does not exist or pass request parameters that cause DotNetNuke to crash.

Just treat this result as a failed request.

痴者 2024-10-01 22:02:23

我通过添加 UserAgent 属性解决了该问题:

hrqURL.UserAgent = "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; .NET CLR 1.0.3705;)";

I've solved the problem by adding the UserAgent property :

hrqURL.UserAgent = "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; .NET CLR 1.0.3705;)";
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文