随笔分类 -  C#

摘要:从git拉取代码以后报错~ 在web.cofig文件注释以下代码: 阅读全文
posted @ 2022-06-14 10:27 PrintY 阅读(160) 评论(0) 推荐(0) 编辑
摘要:using Microsoft.Web.Administration; ServerManager serverManager = ServerManager.OpenRemote(ip); if (serverManager == null) { throw new Exception("获取到数 阅读全文
posted @ 2022-06-08 19:38 PrintY 阅读(717) 评论(0) 推荐(0) 编辑
摘要:受人之托,写个鸡肋博客~,for 二黑 ,PS:黑不是你的错,又黑又胖就是你不对了~ 1、创建SqlHelper类 查看代码 /// <summary> /// ado.net方式执行sql语句 /// Print.Y /// </summary> public class SqlHelper { 阅读全文
posted @ 2022-03-29 09:27 PrintY 阅读(540) 评论(0) 推荐(0) 编辑
摘要:引用 Newtonsoft.Json // Post请求 public string PostResponse(string url,string postData,out string statusCode) { string result = string.Empty; //设置Http的正文 阅读全文
posted @ 2022-03-10 15:18 PrintY 阅读(73) 评论(0) 推荐(0) 编辑
摘要:前言 开头防杠:.NET 的基础库、语言、运行时团队从来都是相互独立各自更新的,.NET 6 在基础库、运行时上同样做了非常多的改进,不过本文仅仅介绍语言部分。 距离上次介绍 C# 10 的特性已经有一段时间了,伴随着 .NET 6 的开发进入尾声,C# 10 最终的特性也终于敲定了。总的来说 C# 阅读全文
posted @ 2021-08-16 20:27 PrintY 阅读(872) 评论(0) 推荐(0) 编辑
摘要:我是搬运工,转自:https://www.cnblogs.com/zd1994/p/4424329.html 一、在讲堆栈之前,我们先看看值类型和引用类型: 1,我们看看值类型与引用类型的存储方式: 引用类型:引用类型存储在堆中。类型实例化的时候,会在堆中开辟一部分空间存储类的实例。类对象的引用还是 阅读全文
posted @ 2021-08-16 15:21 PrintY 阅读(452) 评论(0) 推荐(0) 编辑
摘要:因为csv读取的方式就是每行按照逗号分隔,如果正文中有逗号,那么这列字段就会被引号包裹,这里给出代码,针对这种情况的处理: 1 /// <summary> 2 /// 跳过引号中的逗号,进行逗号分隔(字段内容中的逗号不参与分隔) 3 /// </summary> 4 /// <param name= 阅读全文
posted @ 2020-12-02 22:29 PrintY 阅读(3193) 评论(2) 推荐(0) 编辑
摘要:1 /// <summary> 2 /// ado.net方式执行sql语句 3 /// </summary> 4 public class SqlHelper 5 { 6 /// <summary> 7 /// 执行sql语句,进行查询操作(推荐) 8 /// </summary> 9 /// < 阅读全文
posted @ 2020-12-01 22:09 PrintY 阅读(167) 评论(0) 推荐(0) 编辑
摘要:上次读取了excel发现还是很慢(结果集为DataTable),后来研究了一下csv这个文件效率很高呀,特别是针对大文件的时候,话不多说上代码! 本机配置:win10 i5900F 16G 500G固态 1、csv文件帮助类 1 public static class CsvHelper 2 { 3 阅读全文
posted @ 2020-11-26 21:12 PrintY 阅读(3957) 评论(1) 推荐(3) 编辑
摘要:ASP.NET下C#读取Excel文件,有好几种方法,我了解到的有:Microsoft.Office.Interop.Excel.dll 、 Microsoft.Jet.OLEDB 、NPOI,其中NPOI应该是用的比较多的吧,我个人来说比较倾向使用NPOI,很方便。不过今天我的一个小伙伴突然微信我 阅读全文
posted @ 2020-11-18 23:20 PrintY 阅读(3706) 评论(10) 推荐(1) 编辑
摘要:首先要开放一个外网接口 ReceiveGZH(string signature, string timestamp, string nonce, string echostr) 然后这里定义个验证微信报文签名的方法 1 /// <summary> 2 /// 验证微信签名 3 /// </summa 阅读全文
posted @ 2020-08-24 14:45 PrintY 阅读(717) 评论(0) 推荐(1) 编辑
摘要:c# 模拟表单提交,post form 上传文件、数据内容 阅读全文
posted @ 2019-12-16 19:13 PrintY 阅读(1346) 评论(0) 推荐(0) 编辑
摘要:using Excel = Microsoft.Office.Interop.Excel; Excel.Application excelapp = new Excel.Application(); Excel.Workbook wb = excelapp.Workbooks.Open(excelP 阅读全文
posted @ 2019-11-20 10:58 PrintY 阅读(854) 评论(0) 推荐(0) 编辑
摘要:1 string filePath = @"C:\Users\yangqinglin\Desktop\test.xlsx"; 2 IWorkbook wk = null; 3 string extension = System.IO.Path.GetExtension(filePath); 4 FileStream fs = File.OpenRead(filePath); 5 if (exten 阅读全文
posted @ 2019-11-20 10:41 PrintY 阅读(1735) 评论(0) 推荐(0) 编辑
摘要:1 IWorkbook workbook = new XSSFWorkbook(); 2 ISheet sheet = workbook.CreateSheet("-"); 3 IRow row = sheet.CreateRow(0);//标题 4 5 IRow titleRow = row.CreateCell(0); 6 Row.SetCellValue("标题列1"); 7 8 IRow 阅读全文
posted @ 2019-11-20 09:33 PrintY 阅读(1280) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示