473,399 Members | 3,038 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,399 software developers and data experts.

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 4080
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: amine | last post by:
I really need help on this please. I am writing an application for an Ipaq and I am trying to enable the application to connect to a DAV server which can is basically an HTTP server that acts like...
1
by: Rajiv Barik | last post by:
hi , I am trying to download a zip file from a http site using webResponse . here's the code WebRequest wReq ; wReq = WebRequest.Create(wUri ) ; wReq.Credentials = new NetworkCredential...
0
by: Johann Blake | last post by:
In my need to decode a JPEG 2000 file, I discovered like many that there was no functionality for this in the .NET Framework. Instead of forking out a pile of cash to do this, I came up with the...
2
by: gizmo | last post by:
Hi, I'm using the following code to request the html source from the quoted site. ...... string url = "http://www1.soccerstand.com/"; WebRequest webRequest = WebRequest.Create(url);...
2
by: trialproduct2004 | last post by:
Hi all. i am having problem at a time of validatiang url. I am using webrequest and webresponse class to get content of particular url. My problem is after using webrequest and webresponse class...
2
by: Jeff G. | last post by:
Hello everyone, I have read through the newsgroups (thank God for 'em!) extensively looking for an example of how to pass a file (PDF) from a webresponse stream down to a web client. Here's the...
1
by: Mr Flibble | last post by:
OK I logon to a web site and I manage to get an SMSESSION cookie that I then store in a variable called _session (a class scoping variable). I do this by calling a logon URL and setting a cookie...
0
by: archana | last post by:
Hi all, I am facing very strange problem while using webrequest. What i am doing is i have one url which i want to validate. so i am using webrequest and webresponse. My code is as below:-...
3
by: KyleUbenk | last post by:
Well I have a multi-threaded program which downloads URL sources from the web. Im doing this multiple times at once. The only problem I see is that sometimes it takes a while to download the...
4
by: CindyH | last post by:
Hi - hope someone can help with this - this code was working for a while in the 'real' code and then suddenly stopped - not sure what happen. I made two simple forms on localhost to try to test...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.