随笔分类 -  技术目录十[C#]

摘要:源码: public static bool Contains<TSource>(this IEnumerable<TSource> source, TSource value) { ICollection<TSource> collection = source as ICollection<TS 阅读全文
posted @ 2021-11-15 16:00 vba是最好的语言 阅读(170) 评论(0) 推荐(0)
摘要:源码: public static IEnumerable<TSource> Concat<TSource>(this IEnumerable<TSource> first, IEnumerable<TSource> second) { if (first == null) throw Error. 阅读全文
posted @ 2021-11-15 15:21 vba是最好的语言 阅读(65) 评论(0) 推荐(0)
摘要:源码: public static IEnumerable<TResult> Cast<TResult>(this IEnumerable source) { IEnumerable<TResult> typedSource = source as IEnumerable<TResult>; if 阅读全文
posted @ 2021-11-15 15:15 vba是最好的语言 阅读(77) 评论(0) 推荐(0)
摘要:public static float? Average(this IEnumerable<float?> source) { if (source == null) throw Error.ArgumentNull("source"); double sum = 0; long count = 0 阅读全文
posted @ 2021-11-15 14:57 vba是最好的语言 阅读(35) 评论(0) 推荐(0)
摘要:官网上给的案例: // Custom class. class Clump<T> : List<T> { // Custom implementation of Where(). public IEnumerable<T> Where(Func<T, bool> predicate) { Conso 阅读全文
posted @ 2021-11-15 14:52 vba是最好的语言 阅读(1022) 评论(0) 推荐(0)
摘要:相关源码: public static bool All<TSource>(this IEnumerable<TSource> source, Func<TSource, bool> predicate) { if (source == null) throw Error.ArgumentNull( 阅读全文
posted @ 2021-11-15 14:20 vba是最好的语言 阅读(51) 评论(0) 推荐(0)
摘要://TSource Aggregate<TSource>(this IEnumerable<TSource> source, Func<TSource, TSource, TSource> func); //求和 var list = Enumerable.Range(1, 100); var co 阅读全文
posted @ 2021-11-11 15:23 vba是最好的语言 阅读(71) 评论(0) 推荐(0)
摘要:internal static string MapStringAttributeToString(string s) { // If it's an empty string, change it to null if (s != null && s.Length == 0) return nul 阅读全文
posted @ 2021-11-10 11:18 vba是最好的语言 阅读(34) 评论(0) 推荐(0)
摘要:namespace System { [__DynamicallyInvokable, ComVisible(true)] [Serializable] public delegate void EventHandler(object sender, EventArgs e); } 阅读全文
posted @ 2021-11-01 22:19 vba是最好的语言 阅读(42) 评论(0) 推荐(0)
摘要:string hwrdstr = string.Empty ; hwrdstr = string.Join("、",userEntityList.Select(x => x.Account)); 阅读全文
posted @ 2021-11-01 19:26 vba是最好的语言 阅读(111) 评论(0) 推荐(0)
摘要:要继承IRequiresSessionState 阅读全文
posted @ 2021-10-28 09:46 vba是最好的语言 阅读(18) 评论(0) 推荐(0)
摘要:C#中 TrimEnd()用法 ①去除最后的逗号 string str=ab,cd,ef,; str=str.TrimEnd(new char[] { ',' }); 返回结果则是:ab,cd,ef ②去掉日期格式的00:00:00 char [] strRemove={'0',':'}; lblB 阅读全文
posted @ 2021-10-25 14:12 vba是最好的语言 阅读(817) 评论(0) 推荐(0)
摘要:首先需要Ionic.Zip.dll 页面前台 <body> <form id="form1" runat="server"> <p> <asp:Button ID="PackDown" runat="server" Text="打包下载" OnClick="PackDown_Click" /></p 阅读全文
posted @ 2021-10-20 09:59 vba是最好的语言 阅读(69) 评论(0) 推荐(0)
摘要:问题说明: 1 页面生成后,再次点击其中的button,执行函数中获取成员变量的值为空: 1 2 3 4 5 6 7 8 9 public partial class products : System.Web.UI.Page { private string bigCategory;//= "pr 阅读全文
posted @ 2021-10-18 23:29 vba是最好的语言 阅读(71) 评论(0) 推荐(0)
摘要:这个问题就是:web页面是无状态的怎么使页面里面的变量赋值后,在页面刷新时仍然保持赋给的值利用ViewState来实现,例如: ViewState["AttemptNumber"] = 0; 转载于:https://www.cnblogs.com/burandanxin/archive/2007/1 阅读全文
posted @ 2021-10-18 23:25 vba是最好的语言 阅读(56) 评论(0) 推荐(0)
摘要:public static string HMACSHA1(this string text, string secretKey) { HMACSHA1 hmacsha1 = new HMACSHA1(); hmacsha1.Key = Encoding.UTF8.GetBytes(secretKe 阅读全文
posted @ 2021-10-14 16:39 vba是最好的语言 阅读(388) 评论(0) 推荐(0)
摘要:https://github.com/dotnet/corefx 这个是.net core的 开源项目地址 https://github.com/aspnet 这个下面是asp.net core 框架的地址,里面有很多仓库。 https://github.com/aspnet/EntityFrame 阅读全文
posted @ 2021-10-13 21:24 vba是最好的语言 阅读(126) 评论(0) 推荐(0)
摘要:一个查询的语句只用了2秒,对比了一下,发现50s的那个语句使用的IEnumerable查询,而2s的那个语句用的是IQueryable查询,网上找了一下资料,找到了原因:IEnumerable与IQueryable查询机制的不同。IEnumerable与IQueryable查询机制的不同。 IEnu 阅读全文
posted @ 2021-10-12 21:40 vba是最好的语言 阅读(53) 评论(0) 推荐(0)
摘要:在C#的数据表格DataTable的操作中,有时候因为业务需要,我们需要获取到DataTable所有列或者某一列的数据类型,此时我们可以通过DataTable中的Columns属性对象的DataType属性来获取,获取的DataType属性的返回值为Type类型的对象,获取到DataType属性后, 阅读全文
posted @ 2021-10-12 10:39 vba是最好的语言 阅读(4425) 评论(0) 推荐(0)
摘要:一、List<T>/IEnumerable转换到DataTable/DataView 方法一: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 阅读全文
posted @ 2021-10-11 15:24 vba是最好的语言 阅读(193) 评论(0) 推荐(0)