如何获取一个url的返回值?(100分)

  • 主题发起人 主题发起人 autumn
  • 开始时间 开始时间
A

autumn

Unregistered / Unconfirmed
GUEST, unregistred user!
我知道TIDHttp,TNMHttp可以调用TIDHttp.Get或TNMHttp.Get就可以返回了。
但是我现在Lan里的proxy是Microsoft Internet Security and Acceleration Server 2000,
使用IE能正确浏览网页,但是
使用TIDHttp,TNMHttp都不能正确返回结果。

TIDHttp返回的错误:
403 Forbidden(The ISA Server denies the specified Uniform Resource Locator(URL).
TNMHttp返回的错误是:
Header:
HTTP/1.1 403 Forbidden ( The ISA Server denies the specified Uniform Resource Locator (URL). )
Via:1.1 ISA
Pragma: no-cache
Cache-Control: no-cache
Content-Type: text/html
Content-Length: 3164

Body:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML dir=ltr><HEAD><TITLE>The page cannot be displayed</TITLE>
<STYLE>A:link {
FONT: 8pt/11pt verdana; COLOR: #ff0000
}
A:visited {
FONT: 8pt/11pt verdana; COLOR: #4e4e4e
}
</STYLE>

<META content=NOINDEX name=ROBOTS>
<META http-equiv=Content-Type content="text-html; charset=Windows-1252">
<SCRIPT>
function Homepage(){
<!--
// in real bits, urls get returned to our script like this:
// res://shdocvw.dll/http_404.htm#http://www.DocURL.com/bar.htm

//For testing use DocURL = "res://shdocvw.dll/http_404.htm#https://www.microsoft.com/bar.htm"
DocURL=document.URL;

//this is where the http or https will be, as found by searching for :// but skipping the res://
protocolIndex=DocURL.indexOf("://",4);

//this finds the ending slash for the domain server
serverIndex=DocURL.indexOf("/",protocolIndex + 3);

//for the href, we need a valid URL to the domain. We search for the # symbol to find the begining
//of the true URL, and add 1 to skip it - this is the BeginURL value. We use serverIndex as the end marker.
//urlresult=DocURL.substring(protocolIndex - 4,serverIndex);
BeginURL=DocURL.indexOf("#",1) + 1;
urlresult=DocURL.substring(BeginURL,serverIndex);

//for display, we need to skip after http://, and go to the next slash
displayresult=DocURL.substring(protocolIndex + 3 ,serverIndex);
document.write('<A HREF="' + urlresult + '">' + displayresult + "</a>");
}
//-->
</SCRIPT>

<META content="MSHTML 5.50.4522.1800" name=GENERATOR></HEAD>
<BODY bgColor=#ffffff>
<TABLE cellSpacing=5 cellPadding=3 width=410>
<TBODY>
<TR>
<TD vAlign=center align=left width=360>
<H1 style="FONT: 13pt/15pt verdana; COLOR: #000000"><!--Problem-->The page
cannot be displayed</H1></TD></TR>
<TR>
<TD width=400 colSpan=2><FONT
style="FONT: 8pt/11pt verdana; COLOR: #000000">There is a problem with the
page you are trying to reach and it cannot be displayed.</FONT></TD></TR>
<TR>
<TD width=400 colSpan=2><FONT
style="FONT: 8pt/11pt verdana; COLOR: #000000">
<HR color=#c0c0c0 noShade>

<P>Please try the following:</P>
<UL>
<LI>Click the <A href="javascript:location.reload()">Refresh</A> button,
or try again later.<BR>
<LI>Open the
<SCRIPT>
<!--
if (!((window.navigator.userAgent.indexOf("MSIE") > 0) && (window.navigator.appVersion.charAt(0) == "2")))
{
Homepage();
}
//-->
</SCRIPT>
home page, and then look for links to the information you want.
<LI>If you believe you should be able to view this directory or page,
please contact the Web site administrator by using the e-mail address or
phone number listed on the
<SCRIPT> Homepage();</SCRIPT>
home page. </LI></UL>
<H2 style="FONT: 8pt/11pt verdana; COLOR: #000000">403 Forbidden - The ISA Server denies the specified Uniform Resource Locator (URL). (12202)<BR>Internet Security and Acceleration Server</H2>
</FONT></TD></TR></TBODY></TABLE></BODY></HTML>
 
你可以试一下ICS控件包中的HTTP控件,我以前用它做了个程序在局域网有代理没有发生
问题,具体操作你可以看一下ICS包中自带的DEMO,说不定会使你OK!
 
简单点说就是我的ie设了proxy后能访问外边的网站,但是我使用nmhttp和idhttp就不行。
是否我的设置有问题?我使用的proxy 是m$ isa 2000
 
小秋你玩我呐[:)]
你可以用INET控件,装了VC后会注册一个这个OCX的。他和IE的工作机制是一样的,IE能绕过去,
他也能。[:D]
 
又遇到新问题了!!!
我们Lan的域控制器是ABC
申请的互联网域名是www.ABC.com
现在我的网内的机器使用TIDHttp访问其他站点没有问题了,但是遇到www.abc.com就不能正确解析到
互联网上了[:(!]
报错:socket Error #11001
 
TIDHttp,TNMHttp
也同样可以设置代理的,你设置了么?
 
用proxy 2.0完事了
 
多人接受答案了。
 
后退
顶部