随笔分类 - C#
摘要:#region NameSpaceusing System;using System.Linq;using System.Collections.Generic;using System.Web.UI.WebControls;using System.Transactions;using VAU.Dao;using VAU.Dto;using VAU.Domain;using VAU.EnumType;using VAU.Dao.NHibernate;using System.Web.UI;using Excel = Microsoft.Office.Interop.Excel;using S
阅读全文
摘要:using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Runtime.InteropServices;using System.IO; //Fileusing System.Diagnostics;//Processusing System.Reflection;//引用这个才能使用Missing字段using Excel = Microsoft.Office.Interop.Excel; //操作Excel using System.Data;//DataT
阅读全文
摘要:反射 提供了对程序集,模块和类型的对象,可以使用反射动态创建类型的实例,或从现有的对象提供获取类型并调用其方法或访问其字段和属性。如果代码中使用了属性,可以利用反射对他们进行访问。反射的性能损失主要来源于比较类型,遍历成员,调用成员三种情形,其中比较类型耗时最小,调用成员耗时最多,所以尽量减少采用成员动态调用等反射方式可以提高应用程序性能。除此之外,采取后期绑定,避免将反射方法放到循环内产生放大效应等办法均可以提升反射性能using Loger;using System;using System.Data;using System.Reflection;namespace Module1{ .
阅读全文
摘要:错误描述: 使用 StreamReader 无法读取 Stream using (MemoryStream ms = new MemoryStream()) { StreamReader sr = new StreamReader(ms); string strMemory = sr.ReadToEnd(); //这里报ReadTimeout 异常,而无法读取 }解决方案: 1:先将Sream转化为 byte[]; 2:在将byte[]转化为string即可using (MemoryStream ms = ...
阅读全文
摘要:通过使用Dictionary和List创建数据,比较那个占用的内存更多class Program { static void Main(string[] args) { long start = GC.GetTotalMemory(true); //MultData testData=new MultData(); //var gcMultListStr = MultData.MultListStr(); var gcMultDicStr = MultData.MultDi...
阅读全文

浙公网安备 33010602011771号