
c#
文章平均质量分 81
iking83
激情
展开
-
c# 计时器的三种使用方法
在.net中有三种计时器,一是System.Windows.Forms命名空间下的Timer控件,它直接继承自Componet;二是System.Timers命名空间下的Timer类。Timer控件:Timer控件只有绑定了Tick事件,和设置Enabled=True后才会自动计时,停止计时可以用Stop()控制,通过Stop()停止之后,如果想重新计时,可以用Start()方法来启动计时器。转载 2015-10-17 10:24:33 · 2122 阅读 · 0 评论 -
c# 动态数组
C#中的数组是可以动态分配长度的,实现动态数组有以下几种途径,这里说的动态数组包括动态分配大小和动态增加数据.先来看原始数组: int m = 5; int[] array = newint[m]; array[0] = 2; label1.Text = array[0].ToString() + " + " +array.Length.ToString();结果的输出自然转载 2015-10-25 18:19:47 · 3414 阅读 · 1 评论 -
c#.net smtp 发送邮件
public partial class Form1 : Form { public Form1() { InitializeComponent(); } public static void SendMail(string strSmtpServer, string UserName, string原创 2015-11-26 22:28:10 · 1176 阅读 · 0 评论 -
c# 退出
在c#中退出WinForm程序包括有很多方法,如:this.Close(); Application.Exit();Application.ExitThread(); System.Environment.Exit(0); 等他们各自的方法不一样,下面我们就来详细介绍一下。1.this.Close(); 只是关闭当前窗口,若不是主窗体的话,是无法退出程序的,另外若有托管线程(非主线程),也转载 2015-12-04 10:54:14 · 359 阅读 · 0 评论