如何在我们的网站上查看其他网站的部分(ASP.NET) [英] How to view the part of other website in our web site (ASP.NET)

查看:274
本文介绍了如何在我们的网站上查看其他网站的部分(ASP.NET)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在may网站上显示网站的一部分。网站的链接是



[ LNK ]



i想要的只是在我的网站上显示注释摘要结果的列表。



我尝试过:



我已经尝试了



< pre>& lt; iframe src =http://david.abcc.ncifcrf.gov /api.jsp?type =ENTREZ_GENE_ID& ;;;;;;;;;;;;;;;;;;; / p>

& lt; / iframe>< / pre>







-page.aspx

& lt; asp:Literal ID =tm_litrunat =server>< / asp:Literal>



-page.aspx.cs



WebRequest wrq = WebRequest.Create(https://www.w3schools.com);

WebResponse wrs = wrq.GetResponse();

StreamReader sr = new StreamReader(wrq.GetRequestStream());

string sHTML = sr.ReadToEnd();

sr.Close();



if(sHTML!= string.Empty&& sHTML!= null)

{

tm_lit.Text = sHTML;

}





但这两种技巧都出现如下错误



1)

拒绝显示'帧中的http://david.abcc.ncifcrf.gov/api.jsp?type=ENTREZ_GENE_ID&ids=2919,6347,6348,6364&tool=summary',因为它将'X-Frame-Options'设置为'sameorigin '





2)

无法加载资源:net :: ERR_BLOCKED_BY_RESPONSE

i want to display the part of a web site in may web site. the link of web site is

[LNK]

i want to just show the LIST of "Annotation Summary Results" in my web site.

What I have tried:

I have Tried

<pre>&lt;iframe src="http://david.abcc.ncifcrf.gov/api.jsp?type=ENTREZ_GENE_ID&ids=2919,6347,6348,6364&tool=summary">
&lt;p>Your browser does not support iframes.&lt;/p>
&lt;/iframe></pre>

and

-page.aspx
&lt;asp:Literal ID="tm_lit" runat="server"></asp:Literal>

-page.aspx.cs

WebRequest wrq = WebRequest.Create("https://www.w3schools.com");
WebResponse wrs = wrq.GetResponse();
StreamReader sr = new StreamReader(wrq.GetRequestStream());
string sHTML = sr.ReadToEnd();
sr.Close();

if (sHTML != string.Empty && sHTML != null)
{
tm_lit.Text = sHTML;
}


but both techniques through the same error as below

1)
Refused to display 'http://david.abcc.ncifcrf.gov/api.jsp?type=ENTREZ_GENE_ID&ids=2919,6347,6348,6364&tool=summary' in a frame because it set 'X-Frame-Options' to 'sameorigin'


2)
Failed to load resource: net::ERR_BLOCKED_BY_RESPONSE

推荐答案

如您所见 X-Frame-Options 的值为'sameorigin',这意味着,你不能把这个页面包含在一个不是来自同一个来源(领域)的框架内...

由于该网站属于其他人,未经许可你不能做任何你想要的事情(也许是保护知识产权)...

虽然还有其他可能包含信息(不是网络版) ge,但作为HTML)从另一方面尊重所有者是明智的,而不是努力推(或者可能联系他看看他们说的话)......
As you can see X-Frame-Options has the value 'sameorigin' and that means, you can not include that page inside a frame that not from the same origin (domain)...
As the site belongs to someone else, you can't do anything you want without permission (maybe to protect intellectual property)...
While there are other possibilities to include information (not as web page, but as HTML) from other side it would be wise to respect the owner and not to push hard (or maybe contact him to see what they say)...


[解决]



解决方案是安装浏览器插件。



发布HTTP标头X的网站值为DENY(或具有不同服务器源的SAMEORIGIN)的Frame-Options无法集成到IFRAME中...除非您通过安装忽略X-Frame-Options标头的浏览器插件来更改此行为(例如, Chrome的Ignore X-Frame Headers)。

忽略X-Frame标题 - Chrome网上应用店 [ ^ ]



请注意,出于安全原因,根本不建议这样做。
[Solved]

The solution is to install a browser plugin.

A web site which issues HTTP Header X-Frame-Options with a value of DENY (or SAMEORIGIN with a different server origin) cannot be integrated into an IFRAME... unless you change this behavior by installing a Browser plugin which ignores the X-Frame-Options Header (e.g. Chrome's Ignore X-Frame Headers).
Ignore X-Frame headers - Chrome Web Store[^]

Note that this not recommended at all for security reasons.


这篇关于如何在我们的网站上查看其他网站的部分(ASP.NET)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆