随笔分类 - .NET
C# 简单日志实现
摘要:1、 using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.IO; namespace Chan
阅读全文
C# 利用反射把DataTable转为List
摘要:using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Data; using System.Reflection; using System.Componen
阅读全文
C# 下载文本文件乱码
摘要:if (File.Exists(filePath)) { FileInfo fi = new FileInfo(filePath); context.Response.Clear(); context.Response.ClearHeaders(); context.Response.Buffer
阅读全文
C# 导出Excel的几种简单方法
摘要:1. \t 格式导出 string reStr = "{0}\t{1}\t{2}"; StringWriter sw = new StringWriter(); sw.WriteLine(reStr, "车辆编号", "车牌号", "发动机号"); sw.Close(); string fileNa
阅读全文
C# 写入文件是否包含BOM头
摘要:在c#中向一个文件中写入数据时经常会调用 StreamWriter writer = new StreamWriter(filePath, false, Encoding.UTF8); 后一个参数决定了数据编码。 但是这样写入的文件数据会包含BOM头,好多编辑器无法识别格式。 去除BOM头的方法是:
阅读全文
DLL强签名
摘要:1、强签名 <configuration> <runtime> <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> <dependentAssembly> <assemblyIdentity name="Newtonsoft.Json
阅读全文
C# Fleck SSL加密
摘要://location:websocket监听地址(wss) WebSocketServer server = new WebSocketServer(location); //添加证书(certificatePath:证书路径,password:访问证书数据所需的密码) server.Certificate = new System.Security.Cryptography.X509Certi...
阅读全文
Quartz.NET V2.6.2版本简单使用
摘要:一、Nuget安装命令 Install-Package Quartz -Version 2.6.2 二、代码实现 Program.cs using System; using System.Collections.Generic; using System.Linq; using System.Te
阅读全文