C#WebBrowser类发布到ASP HTML [英] C# WebBrowser class posting to ASP HTML

查看:74
本文介绍了C#WebBrowser类发布到ASP HTML的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

以下源代码在System.Windows.Forms命名空间WebBrowser类上显示Navpost.aspx,但是没有发布值?关于将数据从我的代码发布到html页面的任何建议?

==我的HTML Navpost.aspx ================

The following source-code displays Navpost.aspx on a System.Windows.Forms Namespace WebBrowser class, but without the post values? Any suggestions for getting the data posted from my code to the html page?

== MY HTML Navpost.aspx =================

<HTML>
<%
Dim cFlavor, cName
cFlavor = Request("Flavor")
cName = Request("FName")
%>
<BODY>
Hello, <% =cName %>. <br>
One scoop of <% =cFlavor %> coming right up!
</BODY>
</HTML>




==我的源代码=======================




== MY SOURCE CODE =======================

byte[] SomeBytes = null;
string cPostData = "FName=Allan&Flavor=Vanilla";
SomeBytes = Encoding.UTF8.GetBytes(cPostData);
WebBrowser1.Navigate("http://localhost/Navpost.aspx", "_self", SomeBytes,
        "Content-Type: application/x-www-form-urlencoded\n\r");

推荐答案

一切都很好,除了''\n\r''应该为''\r\n''或只使用Environment.NewLine
Everything looks fine, except that ''\n\r'' should be ''\r\n'' or just use Environment.NewLine


感谢您注意到CRLF落后了;我从网站上获得了这段代码.但是,更正CRLF并没有帮助.原始代码是为Visual Studio 2005编写的,而我使用的是2008,所以我不得不更改Navigate类的参数,因为新的.NET版本没有较旧的参数集.
Thank you for noticing the CRLF was backward; I got this code from a web-site. However, correcting the CRLF didn’t help. The original code was written for Visual Studio 2005 and I’m using 2008, so I had to change the arguments for the Navigate class since the new .NET version didn’t have the older set of arguments.


当我开始对新车进行研究时,发现了该页面,向我展示了有关如何购买新车的所有知识.代理商可以从每笔交易中获利,这是您想不到的更多方法.文档费用,保留费用,财务费用等等.我访问了该网站,他们向我发送了有关如何与汽车经销商进行谈判以及如何在发票下方购买新车的免费信息.阅读了他们发送给我的所有内容后,我对购买过程有了更多的了解,并希望与大家分享.我只是简单地打印了电子书,将其带到经销店,然后我走出那里,所付的费用少于发票.如果您正在寻找新车,这是一些必须阅读的信息,并且它是免费的.请看一下,请发表其他建议,以帮助其他正在购买新车的人.
[url = http://www.newacuraincentives.com/freebook.html]自动协商提示和秘密电子书[/url]
When I started to do research on my new automobile, I came across this page that showed me everything I needed to know about how to purchase a new car. There are more ways than you could think of that the dealership makes money off of every sale; doc fees, holdbacks, finance charges, and so many more. I went to this web site and they sent me FREE information on how to negotiate with a auto dealer and how to purchase a new car below invoice. After reading everything that they sent over to me, I was much more educated on the buying process and wanted to share that with all of you. I simply printed the eBook, brought it to the dealership, and I walked out of there paying less than invoice. If you are in the market for a new car, this is some must read information and it is FREE. Take a look and please post any other advice you might have to help others who are buying a new car.
[url=http://www.newacuraincentives.com/freebook.html]Auto Negotiation Tips and Secrets eBook[/url]


这篇关于C#WebBrowser类发布到ASP HTML的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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