468,783 Members | 1,581 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,783 developers. It's quick & easy.

WebResponse help

How do I get the contents of the HttpWebResponse to display in a web browser
(IE or browser control)? Here is a code snippet. The response ends up
being jscript with a window.open().
webRequest.Method = "POST";

buffer = new byte[urlExecute.Length - 1];

for (int i = 0 ; i < urlExecute.Length - 1 ; i++)

{

buffer[i] =
(byte)Microsoft.VisualBasic.Strings.AscW(urlExecut e.Substring(i,1));

}

webRequest.ContentLength = buffer.Length;

webRequest.KeepAlive = false;

webStream = webRequest.GetRequestStream();

webStream.Write(buffer,0,buffer.Length);

webResponse = (HttpWebResponse)webRequest.GetResponse();
Thanks for the help!
Nov 17 '05 #1
2 3776
Randy wrote:
How do I get the contents of the HttpWebResponse to display in a web
browser (IE or browser control)? Here is a code snippet. The
response ends up being jscript with a window.open().
webRequest.Method = "POST";

buffer = new byte[urlExecute.Length - 1];

for (int i = 0 ; i < urlExecute.Length - 1 ; i++)

{

buffer[i] =
(byte)Microsoft.VisualBasic.Strings.AscW(urlExecut e.Substring(i,1));

}

webRequest.ContentLength = buffer.Length;

webRequest.KeepAlive = false;

webStream = webRequest.GetRequestStream();

webStream.Write(buffer,0,buffer.Length);

webResponse = (HttpWebResponse)webRequest.GetResponse();


A brute force approach would be to dump the response to a local file,
and run IE using the Process class with that local file as input.

Cheers,
--
http://www.joergjooss.de
mailto:ne********@joergjooss.de
Nov 17 '05 #2
I believe this is what you want to do:

http://www.codeproject.com/csharp/winformiehost.asp

HTH

Ollie Riches

"Joerg Jooss" <ne********@joergjooss.de> wrote in message
news:xn****************@msnews.microsoft.com...
Randy wrote:
How do I get the contents of the HttpWebResponse to display in a web
browser (IE or browser control)? Here is a code snippet. The
response ends up being jscript with a window.open().
webRequest.Method = "POST";

buffer = new byte[urlExecute.Length - 1];

for (int i = 0 ; i < urlExecute.Length - 1 ; i++)

{

buffer[i] =
(byte)Microsoft.VisualBasic.Strings.AscW(urlExecut e.Substring(i,1));

}

webRequest.ContentLength = buffer.Length;

webRequest.KeepAlive = false;

webStream = webRequest.GetRequestStream();

webStream.Write(buffer,0,buffer.Length);

webResponse = (HttpWebResponse)webRequest.GetResponse();


A brute force approach would be to dump the response to a local file,
and run IE using the Process class with that local file as input.

Cheers,
--
http://www.joergjooss.de
mailto:ne********@joergjooss.de

Nov 17 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by amine | last post: by
1 post views Thread by Rajiv Barik | last post: by
2 posts views Thread by trialproduct2004 | last post: by
2 posts views Thread by Jeff G. | last post: by
reply views Thread by archana | last post: by
4 posts views Thread by CindyH | last post: by
reply views Thread by zhoujie | last post: by
2 posts views Thread by Marin | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.