brows a html file in win application (c#.net)

hamid

Centurion
Joined
Jul 13, 2004
Messages
114
hi, how can i brows a html file to my win application? (c#.net)
1. i have a javascript file (js) and i want run it in my win app. (as a html file run it)
or
2. i have a html page in same directory of my exe app and i want brows it in my form.
or
3. is there any class that set to a html source string and run it?

thanks
 
Which version of C# are you using? C# 2.0 has a web browser control which can host html files, and while there is no way to simply run javascript code by itself (that I know of), as long as it is part of a web page displayed in a web browser control it will be run just as you would expect when browsing the page in IE.
 
marble_eater said:
Which version of C# are you using?
i use c# 1 (vs2003).
can i brows a html file that there is some javascript in it and it run in my form as IE? (in version C#2)
thank you
 
There is also an ActiveX web browser control you can use. I can't remember the details, but a google search should bring up plenty of info. And if you host an html file in a web browser control, it will behave exactly as it would in Internet Explorer (it is, in fact, an Internet Explorer browser minus the menu, title bar, status bar, et cetera).
 
i used activex before and it was very hard with external dll :-<
thanks anyway
maybe i could use c#2.0 and it have html browser that add to my forms as simple as textbox. is it?
 
All you have to do is add a reference to the appropriate .dll and drop it in like a WinForms control. (On my computer the DLL was located at C:\Windows\System32\shdocvw.dll, the control is named WebBrowser). If this is the control you are using, what is the problem?
 
Back
Top