hamid Posted April 17, 2006 Posted April 17, 2006 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 Quote [ once4ever ]
Leaders snarfblam Posted April 17, 2006 Leaders Posted April 17, 2006 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. Quote [sIGPIC]e[/sIGPIC]
hamid Posted April 17, 2006 Author Posted April 17, 2006 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 Quote [ once4ever ]
Leaders snarfblam Posted April 17, 2006 Leaders Posted April 17, 2006 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). Quote [sIGPIC]e[/sIGPIC]
hamid Posted April 17, 2006 Author Posted April 17, 2006 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? Quote [ once4ever ]
Leaders snarfblam Posted April 17, 2006 Leaders Posted April 17, 2006 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? Quote [sIGPIC]e[/sIGPIC]
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.