随笔 - 394
文章 - 0
评论 - 946
阅读 -
143万
08 2011 档案
界面和线程交互之简单使用说明
摘要:在进行多线程设计过程中,最重要的就是实现线程同步和线程界面交互。如果想实现线程同步,可以通过lock锁来进行;而如果要想线程和界面交互,则需要利用委托来进行。
阅读全文
Castle ActiveRecord学习笔记三:初始化配置
摘要:在使用Castle ActiveRecord的时候,需要两种方式来进行初始化,一种就是通过配置文件,另外一种就是将初始配置进行硬编码,写到程序中来。
当然,一般来说,利用配置文件来进行将会大大简化后期维护,我们首先在程序中添加一个App.config的配置文件,记住,一定要将这个配置文件的生成操作设置为“嵌入的资源”才行。否则会提示如学习笔记二中所出现的问题。
阅读全文
Castle ActiveRecord学习笔记二:“NHibernate.Cfg.Configuration”的类型初始值设定项引发异常
摘要:在进行castle activerecord设计的时候,经常会出现“NHibernate.Cfg.Configuration”的类型初始值设定项引发异常。当时也不知道是怎么回事,反正是弄好了,谁知道第二次修改了一些东西以后,居然又出现了这个错误提示,但是当时就是不知道为什么,摸索了半天,原来是xml嵌入资源的事情。
如果你的项目中有App.config等配置文件,请将其设置为“嵌入的资源”,这样再运行的时候,就不会出错了。
阅读全文
Castle ActiveRecord学习笔记一:创建一个实例
摘要:Castle ActiveRecord抛弃了Nhibernate的繁杂的配置,采用了一种更加方便的方式来组织项目结构,是对Nhibernate的再次封装,大大简化了开发,下面就来说明其配置过程
阅读全文
BackgroundWroker使用方法备忘
摘要:using System;using System.ComponentModel;using System.Windows.Forms;using System.Threading;namespace WindowsFormsApplication1{ publicpartialclass Form1 : Form { public Form1() { InitializeComponent(); worker =new BackgroundWorker(); worker.DoWork+...
阅读全文
匿名方法的一些使用方法备忘
摘要:using System;using System.Collections.Generic;using System.Text; namespace MyDelegate{ class Program { static void Main(string[] args) { List<string> m_liName=new List<string>(); m_liName.Add("sadi"); m_liName.Add("pothik"); m_liName.Add("shiman"); m_liName.
阅读全文
Log4Net使用方法小记
摘要:最近项目中使用到了Log4Net,于是便做了一个小记,来记录下简单的使用情况,具体的,需要等到以后去挖掘。首先就是让Console显示Log4Net日志记录情况,这个不需要什么具体的配置,只需要下载log4net,然后引用相应的dll文件即可。你可以通过http://logging.apache.org/log4net/download.html去下载Log4Net,具体代码如下:using System;using System.Collections.Generic;using System.Linq;using System.Text;using log4net;using log4ne
阅读全文
线程和UI交互的普遍用法
摘要:using System;using System.Windows.Forms;using System.Threading;namespaceThreadBeginInvokeAPP{publicpartialclassmainFrm : Form{public mainFrm(){InitializeComponent();Thread t = newThread(newThreadStart(ChangeLabel));t.Start();//运行线程}privatedelegatevoidSetLabelTextDelegate(int number); //委托privatevoid
阅读全文
Guid属于using System.Runtime.InteropServices命名空间下
摘要:Guid属于using System.Runtime.InteropServices命名空间下,但是在vs2008中,在Guid上面右击,竟然找不到resolve... 奇怪
阅读全文
Thread的join方法使用解析
摘要:在C#中,Thread用的是比较多的,至少在windows form中使用是比较频繁的。一说到线程,可能马上就会想到界面和线程交互的头疼事,多线程之前数据共享,线程异步等等。这些当然是比较头疼的,只要有信心 ,慢慢来,相信理解不是难事。
阅读全文
C# Closures Explained
摘要:Thanks to all of the functional goodness that was put into C# 3.0 we have a ton of power at our disposal. Unfortunately with a lot of this power also comes increased complexity. Programmers usually exacerbate the complexity problem, because unfortunately we often like to sound like we are smarter th
阅读全文
自绘GroupBox控件
摘要:下面显示的是效果图:然后是代码,其中有一些解释:using System;using System.Collections.Generic;using System.ComponentModel;using System.Diagnostics;using System.Text;using System.Windows.Forms;using System.Drawing;using System.Drawing.Drawing2D;namespace scyGroupBox{ public partial class scyGroupBox : GroupBox { private Gra
阅读全文
Asp.net中的HttpModule和HttpHandler的简单用法
摘要:在Asp.net中,HttpModule和HttpHandler均可以截取IIS消息进行处理,这使得我们制作人员能够非常方便的进行诸如图片水印添加,图片盗链检查等功能。下面先就HttpModule的使用方法进行简单说明:using System;using System.Web;namespace MyWebApp{ public class MyHttpModule:IHttpModule { public void Init(HttpApplication application) { application.BeginRequest+=new EventHandler(applicati
阅读全文