相关疑难解决方法(0)

在C#中使用chrome作为浏览器?

有没有办法在Google C#应用程序中使用谷歌浏览器(或Safari或Firefox)作为浏览器?C#现在使用Internet Explorer,他们想要在此程序中使用的网站不支持它.

c# google-chrome embedded-browser

47
推荐指数
5
解决办法
10万
查看次数

Web浏览器控制内存泄漏

我在 webBrowser 控件中遇到内存泄漏问题。我找到了这个线程:

如何解决 .NET Webbrowser 控件中的内存泄漏问题?

和这个:

//dispose to clear most of the references
this.webbrowser.Dispose();
BindingOperations.ClearAllBindings(this.webbrowser);

//using reflection to remove one reference that was not removed with the dispose 
var field = typeof(System.Windows.Window).GetField("_swh", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance);

var valueSwh = field.GetValue(mainwindow);

var valueSourceWindow = valueSwh.GetType().GetField("_sourceWindow", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic).GetValue(valueSwh);

var valuekeyboardInput = valueSourceWindow.GetType().GetField("_keyboardInputSinkChildren", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic).GetValue(valueSourceWindow);

System.Collections.IList ilist = valuekeyboardInput as System.Collections.IList;

lock(ilist)
{
    for (int i = ilist.Count-1; i >= 0; i--)
    {
        var entry = ilist[i];
        var sinkObject = …
Run Code Online (Sandbox Code Playgroud)

c# browser internet-explorer memory-leaks

5
推荐指数
1
解决办法
5562
查看次数