随笔分类 -  C# Language

C# Language
摘要:索引器概述 索引器使得对象可按照与数组相似的方法进行索引。 get 访问器返回值。set 访问器分配值。 this 关键字用于定义索引器。 value 关键字用于定义由 set 索引器分配的值。 索引器不必根据整数值进行索引,由您决定如何定义特定的查找机制。 索引器可被重载。 索引器可以有多个形参,例如当访问二维数组时。 C#语言一个最令人感兴趣的地方就是类的索引器(indexer)。简单说来,... 阅读全文
posted @ 2008-09-01 23:29 Athrun 阅读(559) 评论(0) 推荐(0)
摘要:Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->/* * Created by SharpDevelop. * User: Administrator * Date: 2008/8/27 * Time: 下午 09:44 * 索引器(inde... 阅读全文
posted @ 2008-08-28 00:57 Athrun 阅读(580) 评论(0) 推荐(0)
摘要:Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->/* * Created by SharpDevelop. * User: Administrator * Date: 2008/8/27 * Time: 下午 08:29 * 屬性(prope... 阅读全文
posted @ 2008-08-27 21:41 Athrun 阅读(361) 评论(0) 推荐(0)
摘要:/* * Created by SharpDevelop. * User: Administrator * Date: 2008/8/27 * Time: 下午 04:52 * 類型轉換 * C#中類型轉換的機制分為兩種: * 隱式轉換(Implicit Conversions) * 顯式轉換(Explicit Conversions) * 隱式轉換不需指明欲轉變的目的類型; ... 阅读全文
posted @ 2008-08-27 18:36 Athrun 阅读(404) 评论(0) 推荐(0)
摘要:修飾符 Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->/* * Created by SharpDevelop. * User: Administrator * Date: 2008/8/27 * Time: 下午 12:56 * 修... 阅读全文
posted @ 2008-08-27 12:55 Athrun 阅读(405) 评论(0) 推荐(0)
摘要:Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--> Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->/* ... 阅读全文
posted @ 2008-08-27 10:09 Athrun 阅读(424) 评论(0) 推荐(0)
摘要:Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--> Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->usi... 阅读全文
posted @ 2008-08-27 09:32 Athrun 阅读(511) 评论(0) 推荐(0)
摘要://簡單方法的應用,沒有帶參數 using System; namespace Athrun { class Method { public static void MyMethod() { Console.WriteLine("this is a method"); } static void... 阅读全文
posted @ 2008-08-27 09:21 Athrun 阅读(380) 评论(1) 推荐(0)
摘要:Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->//命名空間的使用 //.NET Framework類庫由命名空間組成.每個命名空間都包含在程序中使用的類型:類,結構,枚舉,委托和接口. using System; namespace Athrun {... 阅读全文
posted @ 2008-08-27 09:01 Athrun 阅读(301) 评论(0) 推荐(0)
摘要:/* * *1,配置--修改電腦的系統環境變數 *我的電腦->內容->高級->環境變數中的系統變數中的path後面加上";"號再加上"C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727"後這時候在cmd環竟下就可以直接使用csc來編譯. * * Created by SharpDevelop. * User: Administrator * ... 阅读全文
posted @ 2008-08-27 08:50 Athrun 阅读(560) 评论(0) 推荐(0)
摘要:轉自:http://dev.csdn.net/article/82/82644.shtm .NET委托:一个C#睡前故事 英文版原作者:Chris Sells(http://www.sellsbrothers.com/) 翻译:袁晓辉(http://www.farproc.com/ http://blog.csdn.net/uoyevoli) 紧耦合 从前,在南方一块奇异的土地上,有个工人名... 阅读全文
posted @ 2008-08-25 17:11 Athrun 阅读(282) 评论(0) 推荐(0)
摘要:很多的朋友对WMI可能见过但理解不深,我也是十分想了解关于WMI的知识,可一直找不对太合适的资料,在网上的一些资料不是有很多错误,就是讲解不清,我有空的时候将关于WMI的知识集中一下,放在这里便于大家学习。本贴会不断增加。 1、 什么是WMI WMI是英文Windows Management Instrumentation的简写,它的功能主要是:访问本地主机的一些信息和服务,可以管理远程计算机... 阅读全文
posted @ 2008-07-08 18:50 Athrun 阅读(805) 评论(0) 推荐(0)
摘要:using System.Text.RegularExpressions; #region 驗證輸入的字符串 /// /// 判斷輸入的字符類型 /// /// 輸入的字串 /// 要驗證的類型 /// 1: 由26個英文字母組成的字串 /// 2: 正整數 /// 3: 非負整數(正整數 + 0) /// 4... 阅读全文
posted @ 2008-06-20 14:56 Athrun 阅读(603) 评论(0) 推荐(0)
摘要:Visual Studio 类设计器是通用语言运行库的多功能、可视化设计环境。使用 Visual Studio 类设计器可以显现类和其他类型的结构,还可以通过可视化表示方法编辑它们的源代码。对类图的更改将直接反映在代码中,且对代码的更改会直接影响设计器的外观。设计器和代码之间的同步关系,使得可视化创建和配置复杂的 CLR 类型变得容易。 类设计器包含一些专门设计的功能,这些功能将有助于重构... 阅读全文
posted @ 2008-03-28 17:05 Athrun 阅读(459) 评论(0) 推荐(0)
摘要:我们经常要做文件上传,而在每个页中写文件上传,会给后期维护带来很大困难,所以我们要做一个公共的类,方便我们的维护。类如下: using System; using System.IO; using System.Web; using System.Web.UI.HtmlControls; namespace Common { public class Upfile { ... 阅读全文
posted @ 2008-01-09 10:55 Athrun 阅读(375) 评论(0) 推荐(0)
摘要:public static string ParseTags(string HTMLStr) { return System.Text.RegularExpressions.Regex.Replace(HTMLStr, "]*>", ""); } 阅读全文
posted @ 2008-01-09 10:32 Athrun 阅读(391) 评论(0) 推荐(0)
摘要:using System.Net.Mail; protected void Page_Load(object sender, EventArgs e){ string strAllEmail = "sdf,sdf,sdf,"; string[] strEachEmail = strAllEmail.Split(','); int i_max=str... 阅读全文
posted @ 2008-01-09 10:29 Athrun 阅读(1231) 评论(0) 推荐(0)
摘要:using System; using System.IO; using System.Collections; using System.Drawing; using System.Drawing.Drawing2D; using System.Drawing.Imaging; namespace BLL { /**//// /// 水印的类型 /// pu... 阅读全文
posted @ 2008-01-09 10:28 Athrun 阅读(1024) 评论(0) 推荐(0)
摘要://开关/c表示执行完命令就退出 System.Diagnostics.Process cmd = System.Diagnostics.Process.Start("CMD.exe", @"/c xcopy c:\test1\*.* c:\test2 /Y /Q /S"); cmd.WaitForExit(); System.Diagnostics.Process.Start("CMD.exe"... 阅读全文
posted @ 2008-01-09 10:24 Athrun 阅读(3182) 评论(0) 推荐(0)
摘要:using System.Text.RegularExpressions; #region 驗證輸入的字符串 /// /// 判斷輸入的字符類型 /// /// 輸入的字串 /// 要驗證的類型 /// 1: 由26個英文字母組成的字串 /// 2: 正整數 /// 3: 非負整數(正整數 + 0) /// 4: 非... 阅读全文
posted @ 2008-01-02 08:56 Athrun 阅读(479) 评论(0) 推荐(0)