相关疑难解决方法(0)

Web浏览器组件是IE7而不是IE8?怎么改变这个?

所以我有一个利用Web浏览器组件的C#Form应用程序.显然是Response.Write(Request.Browser.Version.ToString()); 当我从Web浏览器组件访问我的测试页时返回"7.0".

如何使这个Web浏览器组件使用IE8?

c# webbrowser-control internet-explorer-8 winforms internet-explorer-7

37
推荐指数
3
解决办法
4万
查看次数

ITravelLogStg :: TravelTo失败,错误0x80004002

我有这两种方法来获取当前的旅行日志条目并转到通过调用GetTravelLogEntry方法检索的日志条目:

    public static ITravelLogEntry GetTravelLogEntry(WebBrowser webBrowser)
    {
        int HRESULT_OK = 0;

        SHDocVw.IWebBrowser2 axWebBrowser = (SHDocVw.IWebBrowser2)webBrowser.ActiveXInstance;
        IServiceProvider psp = axWebBrowser as IServiceProvider;
        if (psp == null) throw new Exception("Could not get IServiceProvider.");

        IntPtr oret = IntPtr.Zero;            
        int hr = psp.QueryService(ref SID_STravelLogCursor, ref IID_ITravelLogStg, out oret);            
        if ((oret == IntPtr.Zero) || (hr != HRESULT_OK)) throw new Exception("Failed to query service.");

        ITravelLogStg tlstg = Marshal.GetObjectForIUnknown(oret) as ITravelLogStg;
        if (null == tlstg) throw new Exception("Failed to get ITravelLogStg");            
        ITravelLogEntry ptle = null; …
Run Code Online (Sandbox Code Playgroud)

c# internet-explorer mshtml webbrowser-control

6
推荐指数
1
解决办法
372
查看次数