I have a HTML file I wan开发者_开发知识库t to open in a browser. I want to open this using a .NET application. Being more specific, I want to open this file in a browser each time say the user inputs a variable value ='abc' say. I'm using C# in .NET Is there anyway to do this? Please let me know.
Thanks.
Process.Start(nameOfHtmlFile)
will launch the default browser.
The WebBrowser Class lets you load html files or you can use... System.Diagnostics.Process.Start("IEXPLORE.EXE", "C:\FilePath.html");
Try this:
System.Diagnostics.Process.Start("http://www.google.com");
Source
You need to use a static method System.Diagnostic.Process.Start("YOUR_URL");
In this case you must to replace string "YOUR_URL" by url adress.
For Further Reference : The answer to the question can be found here : http://social.msdn.microsoft.com/Forums/en-US/netfxjscript/thread/e43012b2-8d72-423a-99bd-c6a4ef358077 It uses MSScriptControl and the JS code can just be added into the .NET application as shown. The class name shown should be ScriptControl, not ScriptControlClass.
Thanks, Thothathri
精彩评论