473,322 Members | 1,755 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,322 software developers and data experts.

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 2429

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

Similar topics

9
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
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
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
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
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
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
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
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
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
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work

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.