
C#
文章平均质量分 66
ssll7759
这个作者很懒,什么都没留下…
展开
-
C# LINQ
简单使用的例子 { List list = new List(){0,1,2,23,214}; var rst= list.Where(item => item > 5); var rst2 = list.Where(new Func(item => { return item > 5; }));原创 2012-03-07 01:56:14 · 352 阅读 · 0 评论 -
.NET通用Attirbute
预处理标示特性 Conditional Conditional 应用于方法以启用或禁用程序特定的诊断信息的显示: #define TRACE_ONusing System;using System.Diagnostics;public class Trace{ [Conditional("TRACE_ON")] public static void Msg原创 2012-03-26 20:56:24 · 665 阅读 · 0 评论 -
.NET 反射机制
一般反射接口定义在单独一个程序集内,第三方程序集引用接口并实现接口,并在宿主通过反射得到类型调用接口程序集: ILog接口: public interface ILog { void WriteErrorEvent(string errorMessage); void WriteApplicationEvent(string appli原创 2012-03-26 22:45:45 · 380 阅读 · 0 评论 -
C# 操作符重载 模拟String
模拟String,让引用类型的使用像值类型一样 class MyString { private static Dictionary dic = new Dictionary(); string s; public MyString(string s) { this.s = s;原创 2012-04-03 23:20:19 · 410 阅读 · 0 评论 -
LINQ 排序
随即排序 string[] city = new string[] { "台中", "高雄", "新竹", "台南","屏束" }; var ran = (from x in city orderby Guid.NewGuid() select x).Ta原创 2012-04-08 10:03:53 · 351 阅读 · 0 评论 -
.NET 发送邮件
配置文件中加入 MailMessage msg = new MailMessage(); msg.From = new MailAddress("475504513@qq.com"); msg.To.Add(new MailAddress("475504513@qq.com"原创 2012-03-17 18:29:13 · 550 阅读 · 0 评论