简体   繁体   English

WinForms WebBrowser控件忽略引荐来源

[英]WinForms WebBrowser control ignores referrer

I've encountered the following problem: 我遇到以下问题:

var browser = new WebBrowser();
var header = "Referer: http://testref.com\r\n";
browser.Navigate("http://localhost/test", "_self", null, header");

index.html at /localhost/test contains: / localhost / test的index.html包含:

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"  type="text/javascript"></script>
            <script>
                $( document ).ready(function() {
                alert(document.referrer);}
</script>

and it says that referrer is empty, althought I'd specified. 它说引荐来源网址为空,尽管我已指定。 Why, and how can I force the .net code to send the referer, which will be recognised by js code. 为什么以及如何强制.net代码发送引用,而js代码会识别该引用。 Maybe using 3-party controls will help, like GeckoFx? 也许像GeckoFx一样使用三方控件会有所帮助?

通过使用GeckoFx代替内置控件解决了问题;

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM