明天的明天 永远的永远 未知的一切 我与你一起承担 ??

是非成败转头空 青山依旧在 几度夕阳红 。。。
随笔 - 1277, 文章 - 0, 评论 - 214, 阅读 - 321万
  博客园  :: 首页  :: 管理
< 2025年3月 >
23 24 25 26 27 28 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 1 2 3 4 5

随笔分类 -  C#

上一页 1 ··· 4 5 6 7 8 9 下一页

摘要:我们自定义的类并不像窗体类那样当窗体关闭时自动调用释放函数(实际上是重载基类函数)如下: /// /// 清理所有正在使用的资源。 /// /// 如果应释放托管资源,为 true;否则为 false。 protected override void Dispose(bool disposing) { ... 阅读全文

posted @ 2008-12-27 17:47 且行且思 阅读(3867) 评论(0) 推荐(0) 编辑

摘要:事件通知是最佳方案,以前用一个while(xxx)来等待,后来发现会有一些问题: using System;using System.Text;using System.Windows.Forms;using System.Threading;namespace WindowsApplication1{ public partial class Form1 : Form { ... 阅读全文

posted @ 2008-12-27 16:32 且行且思 阅读(6065) 评论(1) 推荐(0) 编辑

摘要:1.首先引入System.Runtime.InteropServices using System.Runtime.InteropServices; 2.在类内部声明两个API函数,它们的位置和类的成员变量等同. [System.Runtime.InteropServices.DllImport("user32.dll")] //申明API函数 public static exter... 阅读全文

posted @ 2008-12-12 11:28 且行且思 阅读(353) 评论(0) 推荐(0) 编辑

摘要:using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Text;using System.Windows.Forms;using System.Threading;namespace PingBoTes... 阅读全文

posted @ 2008-11-20 10:17 且行且思 阅读(2861) 评论(0) 推荐(0) 编辑

摘要:using System;public delegate int AsyncMethod(int start,int end);//声明一个delegatepublic class AsyncDemo{ public static void Main() { AsyncMethod async = new AsyncMethod(DoSum);//实例化delegate ... 阅读全文

posted @ 2008-11-04 14:26 且行且思 阅读(344) 评论(0) 推荐(0) 编辑

摘要:using System;using System.Collections.Generic;using System.Text; using System.Net;using System.Web;using System.Drawing;using System.Drawing.Imaging; namespace PcRegister{ /**//// /// CrMonterN... 阅读全文

posted @ 2008-08-28 10:45 且行且思 阅读(2625) 评论(0) 推荐(0) 编辑

摘要:int kk = Environment.TickCount; int exeg = Environment.TickCount - kk; MessageBox.Show(exeg.ToString()); 阅读全文

posted @ 2007-07-25 19:35 且行且思 阅读(6950) 评论(1) 推荐(0) 编辑

摘要:private ManualResetEvent _isServerClosed = new ManualResetEvent(false); private void StartThreads() { //生成ABCD四个线程 for (int i = 0; i < 4; i++) // { ... 阅读全文

posted @ 2007-07-22 17:33 且行且思 阅读(1996) 评论(0) 推荐(0) 编辑

摘要:string s = " "; Regex re = new Regex(@"\s+value=([^\s>]+)"); Match m = re.Match(s);if (m.Success)Console.WriteLine(m.Groups[1].Value); ++++++++++++++++++++++++++++++++++++++++++++++起始,结束字符都是固定的,即不是带正... 阅读全文

posted @ 2007-07-11 12:25 且行且思 阅读(1921) 评论(0) 推荐(0) 编辑

摘要:public sealed class IniFile { private string path; /// /// 实例初始化为指定路径的INI文件。 /// /// INI文件路径。 public IniFile(string path) { this.path ... 阅读全文

posted @ 2007-07-10 17:33 且行且思 阅读(1315) 评论(0) 推荐(0) 编辑

摘要:在windows form之间传值,我总结了有四个方法:全局变量、属性、窗体构造函数和delegate。 第一个全局变量: 这个最简单,只要把变量描述成static就可以了,在form2中直接引用form1的变量,代码如下: 在form1中定义一个static变量public static int i= 9 ; Form2中的钮扣按钮如下: private void button1_Click(o... 阅读全文

posted @ 2007-07-07 18:56 且行且思 阅读(2922) 评论(0) 推荐(0) 编辑

摘要://多线程间 控件的操作例子using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Text;using System.Windows.Forms;using System.Threading;usin... 阅读全文

posted @ 2007-06-28 02:11 且行且思 阅读(783) 评论(0) 推荐(0) 编辑

摘要:using System; public class Demo{ static void Main() { string str = "|1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|16|17|18|19|20"; string delimStr = "|"; string[] split = str.Split(... 阅读全文

posted @ 2007-05-10 15:21 且行且思 阅读(1007) 评论(0) 推荐(0) 编辑

摘要:用线程写了一个:using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Text;using System.Windows.Forms;using System.Xml;using System.Thre... 阅读全文

posted @ 2007-04-11 10:57 且行且思 阅读(1830) 评论(1) 推荐(0) 编辑

摘要:代码Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--intday=0;DateTimebeginDay=this.dateTimePicker1.Value;DateTimeendDay=this.dateTimePicker2.Value;intn=... 阅读全文

posted @ 2006-10-27 01:10 且行且思 阅读(658) 评论(1) 推荐(0) 编辑

摘要:timespan 和 datetime是.net 中时间处理的两个主要的类创建并操作一个日期时间对象的方法很简单,下面是简单的实例代码:dimd1asdatetimedimd2asdatetimedimtsastimespand1=datetime.nowd2=d1.addhours(2)ts=d1.subtract(d2)dimts2astimespan(0,1,1,1)ts2=ts2.fromDays(1)dimd3asdatetimed3=d2.add(ts2)上面代码虽然非常简单,但是却已经把所有的精华都体现出来了。d1被赋予当前是时间 ,这样d1=2006-9-18 08:08:08 阅读全文

posted @ 2006-10-01 12:33 且行且思 阅读(4193) 评论(0) 推荐(0) 编辑

摘要:Windows服务是独立于登录用户而工作的Windows应用程序,它通常在计算机启动时开始执行,且常常连续执行,直到计算机关闭为止。像Exchange Server,IIS和杀毒软件等都使用这种方式,这样就可以独立于某一用户而且可以在任何用户登录前来运行,同时也可以服务于所有的进程,从而以一种服务的形式存在。 正因为Windows服务有着这么多的特性,因此,当需要一些特殊功能的时候就可以... 阅读全文

posted @ 2006-09-27 17:16 且行且思 阅读(2824) 评论(0) 推荐(0) 编辑

摘要:C#实现网段扫描 摘要 想必大家对小榕时光等扫描器都非常熟悉了,有没有自己写一个的冲动。最近微软推实施了.NET战略方案,C#是主推语言,你们是否有兴趣用C#来实现对局域网IP地址的扫描,尝试一下自己写的快乐,那么请跟我来。 -------------------------------------------------------------------------------- ... 阅读全文

posted @ 2006-09-26 00:53 且行且思 阅读(3893) 评论(1) 推荐(0) 编辑

摘要:int a = 12345678; //格式为sring输出// Label1.Text = string.Format("asdfadsf{0}adsfasdf",a);// Label2.Text = "asdfadsf"+a.ToString()+"adsfasdf";// Label1.Text = string.Format("asdfadsf{0:C}adsfasdf... 阅读全文

posted @ 2006-09-21 01:03 且行且思 阅读(845) 评论(1) 推荐(0) 编辑

摘要:一、序言 Visual C#.NET是微软公司出品的一种新的编程语言(以下简称C#),它继承了C语言的一些特性,也加入了一些新的元素。以前用过Delphi开发程序的人可能刚开始使用C#的时候,对其有一种似曾相识的感觉(至少包括我)。 是的,C#语言的创始人正是以前在Borland公司开发出Delphi语言的Anders Hejlsberg。在我开始使用C#开发程序时,就觉得它是一款很棒的开发Wi... 阅读全文

posted @ 2006-09-20 02:23 且行且思 阅读(484) 评论(0) 推荐(0) 编辑

上一页 1 ··· 4 5 6 7 8 9 下一页
点击右上角即可分享
微信分享提示