我想创建一个新的GeckoWebBrowser
控件,但是每个控件都有一组单独的Cookie。
我尝试使用此代码,但它给了我一个错误:
<ContractID(TestCookieServiceFactory.ContractID)>
Public Class TestCookieServiceFactory
Inherits GenericOneClassNsFactory(Of TestCookieServiceFactory, TestCookieService)
Public Const ContractID As String = "@mozilla.org/cookieService;1"
End Class
Public Class TestCookieService
Inherits nsICookieConsts
End Class
Public Sub Main()
Xpcom.Initialize("Firefox")
Dim existingFactoryDetails = TestCookieServiceFactory.Unregister()
TestCookieServiceFactory.Register()
Dim browser = New Gecko.GeckoWebBrowser
browser.Navigate("http://www.twitter.com")
End Sub
错误消息:
在Geckofx-Core.dll中发生了类型为'System.Runtime.InteropServices.COMException'的未处理异常
其他信息:未注册类(HRESULT的异常:0x80040154(REGDB_E_CLASSNOTREG))