随笔分类 -  c#基础

摘要:int[] agg = new int[] { 10, 2,3,4,5,6,7,8 }; int[] s = { 1, 2, 3, 4, 45 }; // 计算和 seed 这里对应 0 ,为x 的初始值 var ss = agg.Aggregate(0,(x, y) => { Console.Wr 阅读全文
posted @ 2020-04-24 16:50 谁说程序猿很猥琐 阅读(238) 评论(0) 推荐(0)
摘要:// 什么是Hash // Hash是否一个表结构 哈希表? //Hash 是一个数据结构么? // FNV 是一个简单的,理论上背过后可以手码 //Hash 是一类算法的总称 //解释:Hash,是一种算法,有非常多的哈希公式,又叫做,散列、杂凑、 // 把任意长度的输入,通过哈希算法变化成固定长 阅读全文
posted @ 2020-04-23 21:58 谁说程序猿很猥琐 阅读(139) 评论(0) 推荐(0)
摘要:客户端: System.Net.Sockets.TcpClient tcpClient = new System.Net.Sockets.TcpClient(); tcpClient.Connect(hostname: "127.0.0.1", port: 12345); var stream = 阅读全文
posted @ 2020-04-23 12:22 谁说程序猿很猥琐 阅读(170) 评论(0) 推荐(0)
摘要:using System; using System.Collections.Generic; using System.Linq; using System.Reflection; using System.Text; using System.Threading.Tasks; namespace 阅读全文
posted @ 2020-04-10 14:07 谁说程序猿很猥琐 阅读(239) 评论(0) 推荐(0)
摘要:using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System. 阅读全文
posted @ 2020-04-03 16:07 谁说程序猿很猥琐 阅读(192) 评论(0) 推荐(0)
摘要:一、开篇之前,先给大家推荐一款好用的FTP工具:FTP客户端—IIs7服务器管理工具 --官网地址:http://fwqglgj.iis7.net/cp/ftp/?cmc-zc作为FTP客户端,它支持批量管理ftp站点。定时上传和定时下载,定时备份,且操作简洁。同时iis7服务器管理工具还是vnc客 阅读全文
posted @ 2020-04-03 16:05 谁说程序猿很猥琐 阅读(2342) 评论(1) 推荐(1)
摘要:导出Excel 操作类 using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using NPOI.SS.UserMode 阅读全文
posted @ 2020-04-03 16:03 谁说程序猿很猥琐 阅读(228) 评论(0) 推荐(0)
摘要:////.NET中指针类型的使用 //.NET中指针类型的使用 public static void UseUnsafeCode() { //不安全代码修饰符 unsafe { const int count = 10; Byte[] buffer = new byte[count]; //C# 编 阅读全文
posted @ 2020-04-03 16:00 谁说程序猿很猥琐 阅读(335) 评论(0) 推荐(0)
摘要:通过接口下载文件(服务器和客户端) 客户端: /// <summary> /// 下载文件 /// </summary> /// <param name="URL">下载文件地址</param> /// <param name="Filename">下载后的文件目录(全路径)</param> pri 阅读全文
posted @ 2020-04-03 15:58 谁说程序猿很猥琐 阅读(738) 评论(0) 推荐(0)
摘要:目录--作者:hnZheng * 线程池以异步的方式执行一个方法 * 线程执行上下文 * 在异步线程间取消上下文的流动 * 协作式取消和超时 取消一个正在执行的线程 * System.Threading.Tasks任务的使用 * 等待任务完成并且获取结果 * 任务完成时启动新的任务 * 任务可以启动 阅读全文
posted @ 2020-04-03 15:56 谁说程序猿很猥琐 阅读(213) 评论(0) 推荐(0)
摘要:private void button1_Click(object sender, EventArgs e) { DataTable dt = new DataTable(); dt.Columns.Add("Name", typeof(string)); dt.Columns.Add("Age", 阅读全文
posted @ 2018-09-28 10:09 谁说程序猿很猥琐 阅读(3048) 评论(0) 推荐(0)
摘要:Boolean isTrue = false; // 身份证验证 string regexStr = "^\\d{17}(\\d|x)$"; isTrue = Regex.IsMatch(inputTxt, regexStr); //非负整数 regexStr = "^\\d+$"; isTrue = Regex.IsMatch(inputTxt, regexStr); //正整数 regexS... 阅读全文
posted @ 2018-06-13 17:57 谁说程序猿很猥琐 阅读(144) 评论(0) 推荐(0)
摘要:批量更新数据(BatchUpdate) /// /// 批量更新数据,注意:如果有timestamp列,要移除 /// /// 源数据 /// 目标table /// 主键,根据主键来更新数据,不是自增长 /// 自增长列 /// 列名 /// 条件 /// 批量更新的数量 /// public Boolean BatchUpdate(DataTable sourceTable, stri... 阅读全文
posted @ 2018-06-13 17:55 谁说程序猿很猥琐 阅读(15078) 评论(1) 推荐(0)
摘要:批量新增数据(BuckCopy) 使用webService传输数据时要注意,Datatable中的数据类型,以及科学计数 /// /// 批量新增数据 /// /// 源数据 /// 目标Table的名称 /// 列的集合,null /// 每次新增的数据量 /// 数据库连接 /// 成功与否 public Boolean BuckCopy(DataTable SourceData, st... 阅读全文
posted @ 2018-06-13 17:55 谁说程序猿很猥琐 阅读(829) 评论(0) 推荐(0)
摘要:1、先定义一个 拦截属性 AopAttribute 2 实现 ContextProperty, IContributeServerContextSink 3、 实现事件 执行类(主要) Aspect 4 另外 监听事件的执行 实现上面接口: 6 参数 model 测试: 阅读全文
posted @ 2018-06-12 15:22 谁说程序猿很猥琐 阅读(186) 评论(0) 推荐(0)
摘要:public class NewAtturibute { public void TestFunc() { // 01 Out变量 不用初始化 string input = "111"; if (int.TryParse(input, out int a)) ... 阅读全文
posted @ 2018-05-31 17:31 谁说程序猿很猥琐 阅读(158) 评论(0) 推荐(0)
摘要:public void TestFunc() { Complex complex1 = new Complex(); Complex complex2 = new Complex(); var s = complex1 + complex2; } } pub... 阅读全文
posted @ 2018-05-30 23:01 谁说程序猿很猥琐 阅读(8285) 评论(0) 推荐(0)
摘要:namespace test { // 泛型的协变,T 只能作为返回的参数 public interface Class1<out T> { T Get(); int Count { get; } } public class Class2 : Class1<String> { public Str 阅读全文
posted @ 2018-05-30 22:13 谁说程序猿很猥琐 阅读(378) 评论(0) 推荐(0)
摘要:namespace _6._0新特性 { using static _6._0新特性.Statics.StaticClass; class Program { static void Main(string[] args) { // 特性01 静态的using 声明 //之前的调用方式 类... 阅读全文
posted @ 2018-05-30 21:37 谁说程序猿很猥琐 阅读(155) 评论(0) 推荐(0)