473,406 Members | 2,371 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,406 software developers and data experts.

WebBroswer Control Problem (Simple 2 lines of code!)

Hello!

I am having a very weird problem that I cant find any solution on the Internet (after so many years!). I am trying to code a C# program and I am using the WebBroswer control.

The code is very simple. 1 button and 1 webbroswer control. When the button is clicked I want it to navigate to ebay.com

Expand|Select|Wrap|Line Numbers
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Windows.Forms;
  9.  
  10. namespace WindowsFormsApplication1
  11. {
  12.     public partial class Form1 : Form
  13.     {
  14.         public Form1()
  15.         {
  16.             InitializeComponent();
  17.         }
  18.  
  19.         private void button1_Click(object sender, EventArgs e)
  20.         {
  21.             // This works!
  22.             //webBrowser1.Navigate("http://www.google.com");
  23.  
  24.             // This generates "vshost has stopped working"
  25.             webBrowser1.Navigate("http://www.ebay.com");
  26.  
  27.         }
  28.  
  29.  
  30.     }
  31. }
When the ebay.com loads it generates an error saying "vshost has stopped working" and the application closes. Note that this happens 95% of the time. For some reason some times it works!?!

If however i try google.com it works 100%.

Now for the strange part. Using the second version of the application that works (i.e. webBrowser1.Navigate("http://www.google.com"); ) I search for ebay using google and I manually navigate to ebay.com (meaning I am clicking on the search results link). IT WORKS 100% !

If anyone can help me I would be grateful. I cant find any other info on this problem. Thank you for reading
Apr 7 '08 #1
2 1328
Sure ??

becoz iam using this and its open ebay.com successfully, may be there will be other issue, if know then share with us
Apr 8 '08 #2
Plater
7,872 Expert 4TB
vshost is only used durring debugging sessions.
Apr 8 '08 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Curious | last post by:
Hi List, Obviously my google-fu is very weak and I can't find a simple sample code for C++ that allows me to simply download the source of a specified web page. I'm looking at downloading the...
22
by: Tommy | last post by:
Hi all. I am studying computer security, and I got this short and simple (?) c-code. Something is logical wrong in this code, and if used in the wrong hands of someone, it could be taken advantage...
3
by: candy | last post by:
why this code enters an infinite loop. i dont know what is the problem in while((c=fgetc(file))!='\n' && c!='\r') It enters the infinte loop in this statement. The aim of the program is to...
0
by: M Wagner | last post by:
Hello NG! I need a control, that generates code at design-time. Drag&Drop control to a place at the codebehind-file. After this it should generate a code to this place. How can I do this? I...
6
by: zoltix | last post by:
Hi, I would like to access to execute specific commands but the privileges are not enough from an aspx Page. Because this service run as IU_IISSERVER, therefore aspx hasn’t access to these...
0
by: MS Newsgroups | last post by:
Hi, I am trying to create a table that adds cells through a for each loop. In each cell i would like to create a image control. I have manged to get the control created, but my problem is how to...
1
by: shenhaipeng | last post by:
Guys: An ACCESS-newbie is knocking the door ... I am wondering whether it is possible to run a simple SQL code to add an autonumber field from within a Make-Table query. Right now I am...
1
by: Niron kag | last post by:
Hi, I am writing in .net 1.1 asp.net program in c#. In the code behind I declared a reference html control (frame): HtmlControl rightFrame = (HtmlControl)mainFrame.FindControl("frmRight"); ...
1
by: disha manikumar | last post by:
Simple java code to read an excel sheet and extract only few fields by treating the excel sheet as a flat file. Can anyone suggest a simple java code for this?
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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: 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:
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
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
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...
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,...

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.