摘要: :=这个符号直接取代了var和type,这种形式叫做简短声明。不过它有一个限制,那就是它只能用在函数内部;在函数外部使用则会无法编译通过,所以一般用var方式来定义全局变量。 _(下划线)是个特殊的变量名,任何赋予它的值都会被丢弃。在这个例子中,我们将值35赋予b,并同时丢弃34: 阅读全文
posted @ 2018-11-02 19:14 timliudream 阅读(424) 评论(0) 推荐(0) 编辑
摘要: public class Encrypt { /// /// MD5加密方法 /// /// 传入一个字符串 /// public static string GetMd5(string str, bool toLower = true) { if... 阅读全文
posted @ 2018-11-02 19:10 timliudream 阅读(304) 评论(0) 推荐(0) 编辑
摘要: 程序关闭的时候一定要加上: 因为关闭的时候,不将浏览器关闭的话,会阻塞主线程导致报错。 修复CefSharp浏览器组件中文输入的bug // browser是窗口上的浏览器控件 browser.PreviewTextInput += (o, e) => { foreach (var characte 阅读全文
posted @ 2018-11-02 19:09 timliudream 阅读(2557) 评论(0) 推荐(0) 编辑
摘要: if (!CefSharp.Cef.IsInitialized) { var setting = new CefSharp.CefSettings { Locale = "zh-CN" }; setting.CefCommandLineArgs.Add("disable-gpu", "1"); CefSharp.Cef.Initializ... 阅读全文
posted @ 2018-11-02 19:04 timliudream 阅读(4344) 评论(2) 推荐(0) 编辑
摘要: using CefSharp; using CefSharp.Wpf; namespace Common.Control { internal class CefSharpOpenPageSelf : ILifeSpanHandler { public bool DoClose(IWebBrowser browserControl, IBrowser browse... 阅读全文
posted @ 2018-11-02 19:01 timliudream 阅读(4723) 评论(0) 推荐(0) 编辑
摘要: 这个问题的中文提示是: 未能加载文件或程序集“CefSharp.Core.dll”或它的某一个依赖项。找不到指定的模块 具体原因是因为CefSharp运行时需要Visual C++ Redistributable Packages for Visual Studio 2013这个东西,但是有时候电脑 阅读全文
posted @ 2018-11-02 18:59 timliudream 阅读(9192) 评论(0) 推荐(1) 编辑