随笔分类 - C#
摘要:出处1:https://docs.microsoft.com/zh-cn/visualstudio/ide/optimize-visual-studio-startup-time?view=vs-2017 出处2:https://docs.microsoft.com/zh-cn/visualstud
阅读全文
摘要://Instantiating a Workbook object Workbook workbook = new Workbook(); //Adding a new worksheet to the Workbook object int i = workbook.Worksheets.Add(); //Obtaining the reference of the newly added...
阅读全文
摘要:static void Main(string[] args) { Levenshtein(@"今天天气不错", @"今天的天气不错啊"); Console.Read(); } /// /// 字符串相似度计算 /// //...
阅读全文
摘要:C# 调用继电器api usb_relay_device.dll 代码封装 usb_relay_device.dll 为C++编写
阅读全文
摘要:如果你的 WebService 客户端证书配置都没问题,唯独调用接口会出现这个错误 解决办法: 打开你的证书列表,找到证书指纹: 接下来是重点,复制的时候,切记不要用全选,像这样: 要用鼠标仔细的从第一个“可见”字符选起,到“可见”字符结束,像这样: 请仔细对比以上两张图的差别,不然会像我一样,折腾
阅读全文
摘要:/// /// 图像缩略图处理 /// /// 图像源数据 /// 压缩质量 1-100 /// 缩略图的宽 /// 缩略图的高 /// public static byte[] ConvertToThumbnail(byte[] bytes, i...
阅读全文
摘要:.NET基础类库的System.Threading命名空间提供了大量的类和接口支持多线程。这个命名空间有很多的类。System.Threading.Thread类是创建并控制线程,设置其优先级并获取其状态最为常用的类。他有很多的方法,在这里我们将就比较常用和重要的方法做一下介绍:Thread.Sta...
阅读全文
摘要:/// /// 图形细化 /// /// /// public unsafe Bitmap ToThinner(Bitmap srcImg) { int iw = src...
阅读全文
摘要:/// /// 二值化图像 /// /// /// private static unsafe Bitmap Binaryzation(Bitmap bmp) { Bit...
阅读全文
摘要:本文讨论了C#图像处理中Bitmap类、BitmapData类和unsafe代码的使用以及字节对齐问题。Bitmap类命名空间:System.Drawing封装 GDI+ 位图,此位图由图形图像及其属性的像素数据组成。Bitmap 是用于处理由像素数据定义的图像的对象。利用C#类进行图像处理,最方便...
阅读全文
摘要:/// ///将一个object对象序列化,返回一个byte[] /// ///能序列化的对象 /// public static byte[] ObjectToBytes(object obj) {...
阅读全文
摘要:key和iv向量一定要16字节C# public static string Encrypt(string toEncrypt, string key, string iv) { byte[] keyArray = UTF8Encoding.UTF8.Ge...
阅读全文
摘要:/// /// ASP.NET4.0 表单验证类 /// public class FormRequestValidation : RequestValidator { public FormRequestValidation() { } ...
阅读全文
摘要:System.Web节点下添加 “ 因 URL 意外地以“/Test”结束,请求格式无法识别”解决方法同上
阅读全文
摘要:/// /// 读取Excel表每一行第一列的字符串集合 /// /// 文件路径 /// private string[] ExcelReader(string filePath) { List result = new List(); string connStr = "Provider=Microsoft.Ace.OleDb.12.0;data source=" + filePath + ";Extended Properties='Excel ...
阅读全文
摘要:public class WaveHelper { /// /// 数据流 /// private Stream m_WaveData; private bool m_WaveBool = false; private RIFF_WAVE_Chunk _Header = new RIFF_WAVE_Chunk(); private Format_Chunk _Format = new Format_Chunk(); private Fact_Chunk _Fac...
阅读全文
摘要:/// /// GB2312转换成UTF8 /// /// /// public static string gb2312_utf8(string text) { //声明字符集 System.Text.Encoding utf8, gb2312; //gb2312 gb2312 = System.Text.Encoding.GetEncoding("gb2312"); /...
阅读全文
摘要:namespace mynamespace { public delegate void methodDelegate(object o); public class TimerHandler { private static methodDelegate _method; private static methodDelegate method { get { return _method; } } private static Timer _timer = null; ...
阅读全文
摘要:SQL Server:create function fun_getPY(@str nvarchar(4000))returns nvarchar(4000)asbegindeclare @word nchar(1),@PY nvarchar(4000)set @PY=''while len(@st...
阅读全文
摘要:1 /// 2 /// 扩展类 3 /// 4 public static class Extend 5 { 6 /// 7 /// 扩展Join方法 8 /// 把数组分割 9 /// 截取最后一位10 /// 11 /// 12 /// 间隔符号13 /// 数组14 /// 15 public static string E_Join(this string [] value,string...
阅读全文

浙公网安备 33010602011771号