随笔分类 -  C#

摘要:遍历文件夹及文件using System;using System.Collections;using System.Collections.Generic;using System.IO;using System.Linq;using System.Text;using System.Threading.Tasks;namespace Lab{ class Program { static void Main(string[] args) { ProcessDir(@"F:\Todo\MVC", 1); Co... 阅读全文
posted @ 2012-12-12 13:19 风影极光 阅读(284) 评论(0) 推荐(0)
摘要:[代码] 阅读全文
posted @ 2010-04-09 14:49 风影极光 阅读(314) 评论(0) 推荐(0)
摘要:虚方法和抽象方法都可以供派生类重写,它们之间有什么区别呢?1. 虚方法必须有实现部分,抽象方法没有提供实现部分,抽象方法是一种强制派生类覆盖的方法,否则派生类将不能被实例化。如:[代码]2. 抽象方法只能在抽象类中声明,虚方法不是。其实如果类包含抽象方法,那么该类也是抽象的,也必须声明为抽象的。如: 编译器会报错:[代码]Main.cs(10): 'VSTest.Animal.Sleep()' i... 阅读全文
posted @ 2010-04-02 11:56 风影极光 阅读(253) 评论(2) 推荐(1)
摘要:[代码] 阅读全文
posted @ 2010-03-03 13:16 风影极光 阅读(190) 评论(0) 推荐(0)
摘要:[代码].Net Framework规范[代码] 阅读全文
posted @ 2009-12-22 17:52 风影极光 阅读(255) 评论(0) 推荐(0)
摘要:[代码]如果在方法EnglishGreeting前不使用static,在调用的时候将报错:Error1An object reference is required for the non-static field, method, or property 'ConsoleApplication4.Program.EnglishGreeting(string)' 阅读全文
posted @ 2009-12-22 11:46 风影极光 阅读(398) 评论(0) 推荐(0)
摘要:new:隐藏了父类的虚拟方法;在内存里面重新分配了内存空间来存放新的方法,所以仍然可以访问父类的方法;override:重写了父类的虚拟方法;在内存里面使用的是父类方法使用的内存空间.[代码]         Console.WriteLine(Chicken.x); //output: chicken x   Console.WriteLine(Bird.x); //output: bird x... 阅读全文
posted @ 2009-12-15 00:06 风影极光 阅读(323) 评论(0) 推荐(0)
摘要:class Program { static void Main(string[] args) { //string words = "1,2,3"; //string[] split = words.Split(','); //foreach (string s in split) //{ // if (s.Trim() != "") // Console.WriteLine(s); //} S... 阅读全文
posted @ 2009-12-01 11:09 风影极光 阅读(138) 评论(0) 推荐(0)
摘要://string words = "1,2,3"; //string[] split = words.Split( ','); //foreach (string s in split) //{ // if (s.Trim() != "") // Console.WriteLine(s); //} 阅读全文
posted @ 2009-11-30 13:38 风影极光 阅读(242) 评论(0) 推荐(0)
摘要:开发环境:vs2010beta2使用场景:新闻发布等CMS系统一、创建用于生成静态页面的html模板文件template.html放在web应用程序的根目录下相关代码如下:代码 Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--1<html>... 阅读全文
posted @ 2009-11-27 17:12 风影极光 阅读(911) 评论(1) 推荐(1)
摘要:继承母板页的页面代码:<%@ Page Title="Home Page" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="MasterPageAp._Default" %>一般的页面代码:<%@ Page Lan... 阅读全文
posted @ 2009-11-15 22:45 风影极光 阅读(311) 评论(0) 推荐(0)
摘要:为了逼迫自己学习C#,硬着头皮查阅了New features in CSharp 4.0.docx,在朦朦胧胧中认知着C#4.0 阅读全文
posted @ 2009-11-10 23:50 风影极光 阅读(452) 评论(0) 推荐(0)
摘要:"的作用是转义:Console.WriteLine("Key ""doc"" is not found.");//output: Key "doc" is not found."n含义:换行。在控制台应用程序中相当于Console.WriteLine(); 阅读全文
posted @ 2009-09-27 23:17 风影极光 阅读(459) 评论(0) 推荐(0)
摘要:使用服务器控件button为例方式1、通过button的onclick事件,使用注册脚本的方式:Eg,ClientScript.RegisterStartupScript(this.GetType(), "clear", "<script>test()</script>");方式2、通过button的OnClientClick事件直接调用js函数,js函数通过<%%&... 阅读全文
posted @ 2009-09-27 23:16 风影极光 阅读(195) 评论(0) 推荐(0)
摘要:哈希表,可能对于很多同行来说已经很熟悉.刚开始接触时有点陌生,后来用多了也就熟了.当然网上关于这一个知识点的介绍很多,不过这并不妨碍我个人对此作出自己的总结与理解.  在.NET Framework中,Hashtable是System.Collections命名空间提供的一个容器,用于处理和表现类似key/value的键值对,其中key通常可用来快速查找,同时key不允许重复,并且是区分大小写;v... 阅读全文
posted @ 2009-09-27 23:15 风影极光 阅读(225) 评论(0) 推荐(0)
摘要:身份认证 阅读全文
posted @ 2009-09-21 20:26 风影极光 阅读(168) 评论(0) 推荐(0)
摘要:Error1Unexpected error creating debug information file 'D:\Lion\Study\CompanyCalendar\VacationCategory\obj\Debug\VacationCategory.PDB' -- 'D:\Lion\Study\CompanyCalendar\VacationCategory\obj\Debug\Vaca... 阅读全文
posted @ 2009-08-27 15:41 风影极光 阅读(402) 评论(0) 推荐(0)
摘要:using System.CodeDom.Compiler;using System;using System.Net;using System.CodeDom;using Microsoft.CSharp;using System.IO;using System.Web.Services.Description;using System.Collections.Generic;using Sys... 阅读全文
posted @ 2009-08-27 15:40 风影极光 阅读(887) 评论(0) 推荐(0)
摘要:关于反射:反射:即获得元数据的信息。Typeof 获得数据类型;MethodInfo获得方法的信息。实例1 加载外部的dll文件,并通过反射来调用程序集中的类方法和属性1.1 创建一个类通过反射进行方法调用实例2 通过反射调用当前同一个程序集的类方法和属性此实例完整的代码可参考txt文件的操作篇。应用场景反射常用在工厂模式中。比如一个应用程序的后台数据库为ACCESS、MS SQL和Oracle。... 阅读全文
posted @ 2009-08-25 15:42 风影极光 阅读(277) 评论(0) 推荐(0)
摘要:http://www.gotdotnet.com/http://codeproject.com/http://www.asp.net/http://codeguru.com/http://www.c-sharpconer.com/http://blogs.msdn.com/bclteam/http://blogs.msdn.com/ricom/http://samgentile.com/blog/... 阅读全文
posted @ 2009-08-13 10:00 风影极光 阅读(166) 评论(0) 推荐(0)