zoukankan      html  css  js  c++  java
  • 关于C#的WebBrowser内存占用太大的解决办法

    解决方法如下:

    -- in class definition (在类中引用)
     
            [DllImport("KERNEL32.DLL", EntryPoint = "SetProcessWorkingSetSize", SetLastError = true, CallingConvention = CallingConvention.StdCall)]
            internal static extern bool SetProcessWorkingSetSize(IntPtr pProcess, int dwMinimumWorkingSetSize, int dwMaximumWorkingSetSize);
     
            [DllImport("KERNEL32.DLL", EntryPoint = "GetCurrentProcess", SetLastError = true, CallingConvention = CallingConvention.StdCall)]
            internal static extern IntPtr GetCurrentProcess();
     
    -- code to call when you want to reduce the memory(在方法中执行)
     
                IntPtr pHandle = GetCurrentProcess();
                SetProcessWorkingSetSize(pHandle, -1, -1);
  • 相关阅读:
    WCF
    WCF
    C#
    ASP.NET MVC
    WCF
    关于函数的参数
    关于函数的return
    移动Web开发技巧汇总(转)
    关于reset.css的那些事
    关于iphone自动播放音频和视频问题的解决办法
  • 原文地址:https://www.cnblogs.com/Im-Victor/p/12424653.html
Copyright © 2011-2022 走看看