- 博客(114)
- 资源 (2)
- 收藏
- 关注
转载 C# ICloneable,shallow clone,deep clone.
1 [Serializable] 2 public class Person:ICloneable 3 { 4 public string Name { get; set; } 5 public int Id { get; set; } 6 public int Age { get...
2019-09-20 17:20:00 220
转载 wpf datetime format
<Style TargetType="{x:Type DatePickerTextBox}"> <Setter Property="Control.Template"> <Setter.Value> <ControlTemplate>...
2019-09-20 10:48:00 339
转载 wpf datagrid field to image converter 字段 图片转化器
1 <DataGridTemplateColumn Header="Binding">2 <DataGridTemplateColumn.CellTemplate>3 <DataTemplate>4 ...
2019-09-19 11:16:00 363
转载 wpf button style IsMouseOver
<Style x:Key="workButtonStyle" TargetType="{x:Type Button}"> <Style.Triggers> <Trigger Property="IsMouseOver" Value="False"> ...
2019-09-18 17:20:00 865
转载 Wpf Backgroundworker
<Window x:Class="WpfApp53.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmln...
2019-09-15 17:08:00 404
转载 Parallel.For
static void Main(string[] args) { int i = 0; Parallel.For(0, 100, (x) => { Console.WriteLine(i); i++; ...
2019-09-15 12:24:00 94
转载 Wpf,Unity6
<?xml version="1.0" encoding="utf-8"?><packages> <package id="Prism" version="5.0.0" targetFramework="net452" /> <package id="Prism.Composition" version="5.0.0" targetFrame...
2019-09-11 17:36:00 221
转载 Wpf Prism.Unity 7
Prism.Unity 中UnityBootStrapper已经不用了,可以继承PrismApplication1.Install-package Prism.Unity -v 7.2.0.13672.<prism:PrismApplication x:Class="WpfApplication2.App" xmlns="http://s...
2019-09-09 17:59:00 408
转载 dictionary vs Hashtables
DictionaryDictionary is generic type Dictionary<TKey,TValue>Dictionary class is a strong type < TKey,TValue > Hence, you must specify the data types for key and value.There is no need...
2019-09-08 18:01:00 68
转载 sql
1.query all the store procedures in the specfied db;use MyDBselect * from INFORMATION_SCHEMA.ROUTINES where ROUTINE_TYPE='procedure'2.create proc with while loopcreate proc BatchI...
2019-09-08 15:31:00 86
转载 sql server pivot
SET ANSI_NULLS ONGOSET QUOTED_IDENTIFIER ONGOCREATE TABLE [dbo].[YearSalary]( [year] [int] NULL, [salary] [money] NULL) ON [PRIMARY]GOselect * from yearsalary;...
2019-09-08 15:16:00 194
转载 C# regular expression to validate email
using System;using System.Text.RegularExpressions;namespace ConsoleApp375{ class Program { static void Main(string[] args) { RegularExpressionDe...
2019-09-08 13:32:00 149
转载 Redis
1.Connect to redis.static void RedisDemo() { using (var redis = ConnectionMultiplexer.Connect("localhost")) { IDatabase db = redis.GetDatab...
2019-09-01 19:57:00 192
转载 C# consume RestApi
1.RestSharp.Nuget install RestSharp,Newtonsoft.Json.using System;using RestSharp;using Newtonsoft.Json.Linq;namespace DBDll{ public class RestSharpApi { public ...
2019-08-30 11:53:00 155
转载 SQL
1.query all the store prodecure in the specified db.select * from INFORMATION_SCHEMA.ROUTINES where ROUTINE_TYPE='PROCEDURE';2.find the store procedure text.select ROUTINE_DEFINITION from I...
2019-08-30 09:18:00 84
转载 C# read dll config
public static SqlConnection GetSqlConnection() { Configuration myDllConfig = ConfigurationManager.OpenExeConfiguration(Assembly.GetExecutingAssembly().Locatio...
2019-08-29 20:06:00 210
转载 convert datatable to List<T>
public class DataConvert { public static List<T> ConvertDataTable<T>(DataTable dt) { List<T> data = new List<T>(); fo...
2019-08-28 22:04:00 145
转载 ExcelHelper based on NPOI
//Export data to excel via NPOIpublic static void ExportDataTableToExcel(DataTable dataTable, string excelFileName = null){if (dataTable == null){return;}XSSFWorkbook workbook = ...
2019-08-28 16:46:00 73
转载 C# MySQL,Dapper Trans,list
static async Task MySQLTransDemo() { try { using(dbConnection) { dbConnection.Open(); ...
2019-08-09 16:03:00 93
转载 mysql error 1364 Field doesn't have a default values
https://stackoverflow.com/questions/15438840/mysql-error-1364-field-doesnt-have-a-default-values.use super priviledge.Error Code: 1227. Access denied; you need (at least one of) the SUPER p...
2019-08-08 19:50:00 482
转载 C# based on PdfSharp to split pdf files and get MemoryStream C#基于PdfSharp拆分pdf,并生成MemoryStream...
install-package PdfSharp -v1.51.5185-betausing System;using PdfSharp.Pdf;using System.IO;using PdfSharp.Pdf.IO;using System.Collections.Generic;namespace ConsoleApp2{ clas...
2019-07-04 16:17:00 275
转载 C# iText split PDF C# 拆分PDF
Nuget install iText7using iText.Kernel.Pdf;using System.Linq;using System.Text;using System.Threading.Tasks; using System.Configuration; using iText.Kernel.Utils;using iText.Kern...
2019-07-01 19:37:00 613
转载 C#网页 截图
using System.IO;using System.Drawing;using System.Drawing.Imaging;using System.Threading;using System.Windows.Forms;using System;namespace ConsoleApp1{ public class Captur...
2019-07-01 19:34:00 535
转载 磁盘读写受保护
http://mtoou.info/cipanbeixiebaohu/index.html①打开运行(快捷键Win+R)→输入regedit后回车②找到这个目录:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\StorageDevicePolicies③在点击一下StorageDevicePolicies后,会看到窗口右...
2019-06-21 23:57:00 137
转载 WPF Customize DelegateCommand
public class DelCmd : ICommand { private readonly Predicate<object> _canExecute; private readonly Action<object> _execute; public event EventHandler Can...
2019-06-10 13:28:00 106
转载 System.InvalidOperationException: 'Cannot create more than one System.Windows.Application instance i...
System.Windows.Application is a singleton: its constructor must only be invoked once (including App.xaml de-xamlization), or exception is thrown.转载于:https://www.cnblogs.com/Fred1987/p/10990803....
2019-06-08 15:24:00 280
转载 C# NPOI Export DataTable C# NPOI导出DataTable 单元格自适应大小
1.Install-Package NPOI -v 2.4.02.using NPOI.XSSF;using NPOI.XSSF.UserModel;using NPOI.SS.UserModel;using System.IO; static void ExportDataTable(DataTable dt) { ...
2019-06-05 19:43:00 584
转载 wcf configuration
<system.serviceModel> <bindings> <basicHttpBinding> <binding name="BasicHttpBinding_IGetDataTable" messageEncoding="Text" maxReceivedMessage...
2019-06-04 09:47:00 96
转载 error: open(".vs/ConsoleApp349/v16/Server/sqlite3/db.lock"): Permission denied error: unable to inde...
第一种1.git add --ignore-errors .特别注意 git add --ignore-errors .errors后面有一个空格再加一个点'.'第二种:1.touch .gitignore;2.添加要省略的文件.vs/转载于:https://www.cnblogs.com/Fred1987/p/10934705.html...
2019-05-28 00:49:00 1479
转载 C# Large Files MD5 C# 获取大文件MD5
using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading.Tasks;using System.Net.Mail;using System.Net; using System.Threading;...
2019-05-22 00:34:00 465
转载 C# SmtpClient 发邮件
using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading.Tasks;using System.Net.Mail;using System.Net; using System.Threading;usi...
2019-05-22 00:13:00 1091
转载 Windows Server 2008 R2 install Visual Studio 2015 failed
Please download and installWindows Server 2008 R2 Service Pack 1 (KB976932).https://www.microsoft.com/en-us/download/details.aspx?id=5842转载于:https://www.cnblogs.com/Fred1987/p/10903092.h...
2019-05-21 23:04:00 411
转载 C# 下载泛型数据
public class ExportTByNPOI { [STAThread] public static void ExportTDataByNPOI<T>(List<T> dataList,string fileName) { if(dataList!=null ...
2019-05-19 23:20:00 75
转载 SetApartmentState(ApartmentState state).Ensure that your Main function has STAThreadAttribute marked...
System.Threading.ThreadStateException: 'Current thread must be set to single thread apartment (STA) mode before OLE calls can be made. Ensure that your Main function has STAThreadAttribute mar...
2019-05-19 23:17:00 240
转载 ADO.NET
<connectionStrings><add name="connString" connectionString="Data Source=FRED;Initial Catalog=AdventureWorks2017;Integrated Security=SSPI"/></connectionStrings> stat...
2019-05-19 21:54:00 53
转载 WPF DataGrid row background converter datagrid 行背景随绑定数据变化,转换器
<DataGrid Grid.Row="1" ItemsSource="{Binding SalesList,UpdateSourceTrigger=PropertyChanged,Mode=TwoWay}" AutoGenerateColumns="False"> <DataGrid.RowStyle> ...
2019-05-12 21:50:00 733
转载 C# 截图ScreenCapture,保存
简化版:using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading.Tasks;using System.Drawing;using System.Windows.Forms;using System.I...
2019-05-12 14:09:00 723
转载 Hashtable 负载因子Load Factor
负载因子(load factor),它用来衡量哈希表的空/满程度,一定程度上也可以体现查询的效率,计算公式为:The ratio of the number of elements in the hash table to the table size iscalled the load factor. Studies have shown that hash table pe...
2019-05-07 21:17:00 1395
转载 C# NPOI Excel
using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading.Tasks;using System.Reflection;using NPOI.XSSF.UserModel;using NPOI.SS.UserModel;using Syst...
2019-02-23 16:29:00 116
转载 C# CSV Generic T
This artice will write the main step to export generic data via csv with complete code and step by step.1.Down load EntityFrameworkInstall-package entityframework -v 6.2.02.Add EF data mode...
2019-01-31 22:51:00 82
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人