473,494 Members | 2,266 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Using the WebClient and the Web Browser control together in VB.Net

Here is my perplexing issue and I've looked EVERYWHERE for help (well almost
everywhere.... probably should have started here :))
I am using a Webclient to successfully retrieve a "downloadata" string that
contains a fully formed HTML page from a CGI-based process on a Web server. I
need to use the Webclient because it a) allows me to specifiy credentials
and b) forms the query string in a very readable and maintainable fashion.
Here is the code for the Webclient retrieve:

Dim myWebClient As New WebClient
myWebClient.Credentials = CredentialCache.DefaultCredentials

' Create a new NameValueCollection instance to hold the QueryString
parameters and values.
Dim myQueryStringCollection As New NameValueCollection

'Assign the report interface to the query string
myQueryStringCollection.Add("IBIF_ex", "TW_allocation.fex")
'Assign the variables and values for the report
myQueryStringCollection.Add("IA_STATUS", "F")
myQueryStringCollection.Add("IA_PUBLICIND", "N")
myQueryStringCollection.Add("IA_DATERANGE", "TODAY")
myQueryStringCollection.Add("IA_FROMDATE", Today())
myQueryStringCollection.Add("IA_TODATE", Today())

' Attach QueryString to the WebClient.
myWebClient.QueryString = myQueryStringCollection
Dim myDatabuffer As Byte() = myWebClient.DownloadData(WFRptURL)

' RETURN the downloaded data.
Dim download As String = Encoding.ASCII.GetString(myDatabuffer)
Return download

The problem: Now that I have this wonderful HTML string returned by the CGI
process, how do I get it to display in a Web Browser control on my Windows
Form?
There do not appear to be any methods or properties in the Web Browser
control (shdocvw.dll) that let me assign this string as a document to be
displayed in the browser window (or said differently, before I do a .Show()
on the browser control how do I tell it what to show?).

Also, I can't do a "navigate" method on the Web browser control (I think)
because I need to supply credentials to the Web Server (I haven't seen
anywhere where you can supply credentials with the Web browser control).
Im am using VS.Net 2003.
A lifetime of good karma to the person that can help me with this!
--
Thank You. Alan.
Sep 26 '05 #1
0 2433

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
708
by: Kueishiong Tu | last post by:
I am using webclient to retrieve data from a web site. How do I control the time-out of this request?
4
2286
by: brianinbox | last post by:
Hi, I've been trying to upload file using webclient.uploadfile method from my IIS webserver to an Apache webserver without any success. On the Apache server (server that receives the incoming...
7
3925
by: Crirus | last post by:
Hi all! I use a webClient for requesting data from a server of mine. Should I worry about long ammount of data sent by server in the client side? Or, another way, should I send some kind of a...
1
3104
by: Scampi | last post by:
Hi, I've been working on an application to do some 'scraping' of web content, using the WebClient class. I'm using code rather like the following.. Dim objWebClient As New WebClient Dim...
0
421
by: AlanF | last post by:
Here is my perplexing issue and I've looked EVERYWHERE for help (well almost everywhere.... probably should have started here :)) I am using a Webclient to successfully retrieve a "downloadata"...
0
1236
by: galan1971 | last post by:
Hello, I'm trying to post to a page on a remote server and retrieve the result page and all is working fine except for one thing, the images which are dynamically created on the remote server...
4
2679
by: Michael Duclon | last post by:
Does anyone know how I might use the webclient class to navigate to a web page in a vb.net app, and then if a JavaScript popup appears from the web page I go to, read the message in it or content...
1
6461
by: Mad Scientist Jr | last post by:
For some reason I can't get a WebClient to access an outside URL from behind our firewall. The code works when it runs outside the firewall. I turned on windows authentication in the web.config...
6
6127
by: =?Utf-8?B?U2FtZWVrc2hh?= | last post by:
Hi, I want to write a simple .net program to open a URL, fill in fields, and click on a button to submit it using .net 1.1 framework. Can someone help in suggesting the libraries I should use?...
0
7119
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7157
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
7195
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...
1
6873
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
5453
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
4579
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3088
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3078
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1400
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

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.