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

microsoft web browser component in c#.net

hi
i m using microsoft web browser component in c#.net
i want that wen i open any url in that then the source of that url
come in my string

example: open any url say,yahoo.com in IE or firefox.
go in View--->source

i want that source to collect in any string or , etc,

i am using microsoft web browser for this how to retrieve that
source???
i want that wen i write any url in textbox of microsoft web browser ,
i get that source

any suggestions
Thanks'
Atul

Mar 6 '07 #1
2 2790
Atul, You can directly read the URL and open a response stream to read the
source/contents.
See if the following code helps, the 'result' string will contain the source
of your webpage.

ttpWebRequest request =
(HttpWebRequest)WebRequest.Create("http://www.google.com");

System.Net.WebProxy myProxy = new
System.Net.WebProxy("proxy1.emirates.net.ae", 8080);

myProxy.BypassProxyOnLocal = true;

request.Proxy = myProxy;

request.MaximumAutomaticRedirections = 4;

request.Timeout = 20000;

request.Credentials = CredentialCache.DefaultCredentials;

HttpWebResponse response = (HttpWebResponse)request.GetResponse();

Stream receiveStream = response.GetResponseStream();

StreamReader readStream = new StreamReader(receiveStream, Encoding.UTF8);

string result = readStream.ReadToEnd();

response.Close();


"atul" <at**********@yahoo.comwrote in message
news:11**********************@j27g2000cwj.googlegr oups.com...
hi
i m using microsoft web browser component in c#.net
i want that wen i open any url in that then the source of that url
come in my string

example: open any url say,yahoo.com in IE or firefox.
go in View--->source

i want that source to collect in any string or , etc,

i am using microsoft web browser for this how to retrieve that
source???
i want that wen i write any url in textbox of microsoft web browser ,
i get that source

any suggestions
Thanks'
Atul

Mar 6 '07 #2
webcontrol.DocumentText.ToString() will give you the actual html rendered
into webcontrol.

Happy coding,
--
If this suggestion works with you, Click YES for below question "Was this
post helpful to you?"

Every thing is perfect, as long as you share!!!
"atul" wrote:
hi
i m using microsoft web browser component in c#.net
i want that wen i open any url in that then the source of that url
come in my string

example: open any url say,yahoo.com in IE or firefox.
go in View--->source

i want that source to collect in any string or , etc,

i am using microsoft web browser for this how to retrieve that
source???
i want that wen i write any url in textbox of microsoft web browser ,
i get that source

any suggestions
Thanks'
Atul

Mar 6 '07 #3

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

Similar topics

476
by: Xah Lee | last post by:
Microsoft Hatred, FAQ Xah Lee, 20020518 Question: U.S. Judges are not morons, and quite a few others are not morons. They find MS guilty, so it must be true. Answer: so did the German...
0
by: John Mac | last post by:
I have a program that encapsulates the IE browser via the AxSHDocVw.AxWebBrowser technique. All works fine. It seems to me there should be a way to locate and wire up to an ActiveX/COM...
0
by: yaniv | last post by:
Hi, Im using a microsoft web browser component (shdocvw.dll). The question is, Is there a way to disable cookies or to delete them ? thanks, Yaniv.
0
by: Khalilskp | last post by:
I have used wbe browser control in my project. I place two web browser control on two different froms. I want to login on a site by giving two user name and password. when i give login name and...
2
by: cashdeskmac | last post by:
I have added a Microsoft Web Browser control to my toolbox and placed it on my form. However, the LocationURL is readonly. Is there any way to set the URL so that when the form loads, the page...
22
by: Andy Dingley | last post by:
http://www.microsoft.com/mac/products/internetexplorer/internetexplorer.aspx?pid=internetexplorer Microsoft will end support for Internet Explorer for Mac on December 31st, 2005, and will provide...
0
by: atul | last post by:
open this url http://www.amarujala.com/today/homenews.asp?home=babita2.asp wen we view source then frames are used here in source, the text hindi content doesnot come bcoz that is in frames....
105
by: sw | last post by:
Hi all, I have a news website tat is developed on joomla 1.5.Login facility is done thru a login component.On each page,ther s a 'Log In' link that redirects them to a login page.On successful...
2
by: joelkeepup | last post by:
Hi, I made a change this morning and now im getting an error that says either "a is undefined or null" or "e is undefined or null" the microsoft ajax line is below, I have no idea how to...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.