Question

In my VB6 application i am using SHDocVw.InternetExplorer and navigate websites, fill texbox , submit etc.

Dim iE As New SHDocVw.InternetExplorer
iE.Navigate "www.google.com"
iE.Visible = True

So how can I do the same using chrome as a instance. I would be able to all functionality like I do in SHDocVw.InternetExplorer.

Please guide me. .NET solutions are also welcome

Était-ce utile?

La solution

I don't quite understand your question and my vb6 is extremely dusty (not to say that is a big old now)... The SHDocVw has only defined Internet Explorer as a browser that can be used by the platform and it was a hook to access the Internet Explorer launcher.

In .net you could access an instance of Chrome that is hosted on your application using libraries such as CEFSharp. You will need to create a window and place your chrome browser as a control of it. Once you have done that you will be able to navigate to the page you want.

I had a quick look around and couldn't find a wrapper for vb6 but there are lots of samples for .net (I can provide a sample for WPF if you are interested).

A different way (which I wouldn't recommend) is launching the chrome process with the arguments you want to provide. For example, the following command line should open up chrome (if installed) with two tabs, each with the url provided:

start chrome "http://www.google.com" "http://www.stackoverflow.com"

In that case (as mentioned above) you will need to check the registry if Chrome is installed before trying to start it.

Reference to CEFSharp

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top