随笔分类 - C#进阶
摘要:事件:事件是委托的安全包裹,让委托更加安全 是一种特色的变量类型 事件只能用+= -=来,而委托还可以用= 或者new来赋值 委托:以方法形式调用 ; 也可以+=,-=形式调用 1 2 //以方法参数形式调用 3 4 SayHello("小红", chinesehHello); 5 6 7 //以+
阅读全文
摘要:随大流的用.net core也没有系统的学习,只知道.net core支持跨平台,其他的点上没办法讲出个一二,今天听老师讲到的一个点,记录下来 官网介绍:https://docs.microsoft.com/zh-cn/dotnet/core/about 测试点:在.net core/.net fr
阅读全文
摘要:1:使用Aspose.Cells.dll方式 ps: Aspose.Cells 插件 是收费插件 使用过程可能存在的问题:单元格数据大于32K不能写入excel 处理方式: 可将过大的单元格数据写入文本框等 读取数据,当行列数超过一定范围会报错: 如果出现以下情况之一,则可能显示此消息:文件所含行列
阅读全文
摘要:答案:Hello678 解析:\r 返回一行的开头,并且占用前面的位数
阅读全文
摘要:1 namespace UnitTestProject1.BaseDesign 2 { 3 4 /// <summary> 5 /// 工厂方法模式要求:尽量使用抽象类或接口来定义就可以达到一个开闭原则 6 /// </summary> 7 [TestClass] 8 public class BaseDesign 9 { 10 [TestMethod] 11 public void TestMe
阅读全文
摘要:1 namespace UnitTestProject1 2 { 3 4 /// <summary> 5 /// 简单工厂模式的缺点: 6 /// 增加具体产品时,需要修改工厂类里面生成具体产品的方法,这就违反了开闭原则。具体产品经常发生变化时,不建议使用简单工厂模式。 7 /// 8 /// </summary> 9 [TestClass] 10 public class simpleDesig
阅读全文
摘要:FlagAttriute ,指示可将枚举视为位域(即一组标志)。 官网中文解说:https://docs.microsoft.com/zh-cn/dotnet/api/system.flagsattribute?redirectedfrom=MSDN&view=netframework-4.7.2
阅读全文
摘要:委托汇总以及遗留问题: 多播委托:其实也算是调用父类中的Combine和Remove方法实现,如下图所示: 上图对应结果为: QueryUser:返回用户:sun, 年龄:88 可输出对应的string返回结果,返回结果是最后一个委托方法返回值
阅读全文
摘要:1 using System; 2 using System.Collections; 3 using System.Collections.Generic; 4 using System.Linq; 5 using System.Text; 6 using System.Threading.Tasks; 7 8 namespace ConsoleDemo.Li...
阅读全文
摘要:public class ExcelFileHelper { public static bool SaveAsCsv(string excelFilePath, string destinationCsvFilePath) { using (var stream = new FileStream(
阅读全文
摘要:using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Xml; using System.Data; using System.IO; using Syste
阅读全文
摘要:1 using System; 2 using System.Collections.Generic; 3 using System.Linq; 4 using System.Text; 5 6 using System.Data; 7 using System.IO; 8 using System
阅读全文
摘要:using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Data; using System.Data.OleDb; using System.IO; nam
阅读全文
摘要:心好累,印象笔记国内版和国际版账号还不能通用,在国内版写了一个没法创建共享链接(只有共享给XXemail),于是又写了一遍到国际版上(因为图片无法复制,又copy了一遍图片),现在copy到博客园,图片又拷贝不了. 共享URL: 使用c#创建Excel 2013外接程序 1:如何创建一个外接程序 A
阅读全文

浙公网安备 33010602011771号