使用VB.net在IE中隐藏工具栏
问题描述:
你好,
我正在尝试从用VB.net编写的应用程序打开一个网页(正在运行).但是,我需要在IE窗口中隐藏所有工具栏.现在我正在使用Process.Start打开一个新窗口,但是想像一下我还需要其他东西来更改IE中的设置吗?有什么办法吗?谢谢!
System.Diagnostics.Process.Start("IExplore.exe",url)
Hello,
I''m trying to open a webpage from my application written in VB.net (which is working). However, I need to hide all toolbars in the IE window. Right now i''m using Process.Start to open a new window, but imagine I would need something else to change settings in IE? Any solutions? Thanks!
System.Diagnostics.Process.Start("IExplore.exe", url)
答
要控制外部进程始终是一个问题.进程之间完全隔离,并且IExplore.EXE并不是您可以根据需要设计的应用程序.相反,要获得完全控制,如何将控件System.Windows.Forms.WebBrowserBase
或System.Windows.Controls.WebBrowser
与WPF应用程序窗体一起使用?参见:
http://msdn.microsoft.com/en-us/library/system. windows.forms.webbrowser.aspx [ ^ ],
http://msdn.microsoft.com/zh-cn/library/system.windows.controls.webbrowser%28v = vs.95%29.aspx [ http://www.w3schools.com/jsref/met_win_open.asp [ ^ ].
这取决于您究竟需要什么,取决于您的最终目标.—SA
Starting external process is always a problem when you want control over it. Processes are well isolated, and IExplore.EXE is not your application which you could design to your needs. Instead, to have full control, how about using the controlSystem.Windows.Forms.WebBrowserBase
orSystem.Windows.Controls.WebBrowser
with Forms of WPF application? See:
http://msdn.microsoft.com/en-us/library/system.windows.forms.webbrowser.aspx[^],
http://msdn.microsoft.com/en-us/library/system.windows.controls.webbrowser%28v=vs.95%29.aspx[^].
Also, please see my comment to the question. I''m not sure what are your requirements and what is the functionality of software you want to open your URL with. You could use JavaScriptwindow.open
function which has detailed view options for the window, see http://www.w3schools.com/jsref/met_win_open.asp[^].
It depends on what exactly you need, on your ultimate goals.—SA