02 2022 档案
摘要:使用DispatcherUnhandledException捕捉未经处理的异常 using System.Windows; namespace Test02 { /// <summary> /// Interaction logic for App.xaml /// </summary> publi
阅读全文
摘要:WPF设置单实例启动 使用Mutex设置单实例启动 using System; using System.Threading; using System.Windows; namespace Test02 { /// <summary> /// Interaction logic for MainW
阅读全文
摘要:WPF 自定义依赖属性 为一个UserControl自定义一个依赖属性MyColor改变UserControl的前景色 using System.Windows; using System.Windows.Controls; using System.Windows.Media; namespace
阅读全文
摘要:C#读取SQLite数据库中文乱码 C#在读取C++写入数据的Sqlite数据库中的Text内容时,会出现乱码,因为C++默认编码格式为GB2312,而Sqlite编码格式为UTF-8,存入时不统一就会出现乱码 using System; using System.Data; using Syste
阅读全文
摘要:C#正则表达式 1.利用正则表达式提取数字 string str = @"asde-1.23,asd3.44uthg666ytut+2.55rer0.77#*@"; MatchCollection match = Regex.Matches(str, @"[+-]?\d*[.]?\d+"); for
阅读全文
摘要:当一个类拥有了自定义的构造函数后,则默认构造函数不能使用! Prism各种自定义构造函数的前提。 此时使用默认构造函数新建类会报错。 添加默认构造函数为自定义构造函数后,则不会报错。
阅读全文