摘要: using System;using System.Collections.Generic;using System.Text;using System.IO;//namespace DESFileSmart{ public class DESFileSmartClass { /// <summary> /// 加/解密文件算法 /// </summary> /// <param name="inFile"></param> /// <param name="outFile"></para 阅读全文
posted @ 2011-05-04 13:57 Yao,Mane 阅读(564) 评论(0) 推荐(0) 编辑
摘要: BackgroundWorker 组件用来执行诸如数据库事务、文件下载等耗时的异步操作。开始在应用程序中添加一个BackgroundWorker实例,如果用的是VS,可以从工具上直接拖到应用程序:BackgroundWorker backgroundWorker1 = new BackgroundWorker();为了开始在后台操作,必须调用BackgroundWorker的RunWorkerAsync()方法,当调用此方时,BackgroundWorker 通过触发DoWork 事件,开始执行后台操作,DoWork 事件的代码是在另一个线程里执行的。代码如下:代码一:BackgroundWo 阅读全文
posted @ 2011-05-04 13:47 Yao,Mane 阅读(529) 评论(0) 推荐(1) 编辑
摘要: 首先引用 using System.Text.RegularExpressions;给TextBox添加KeyPress事件,代码如下:private void textBox1_KeyPress(object sender, KeyPressEventArgs e){if ((Convert.ToInt32(e.KeyChar) == 8)) {e.Handled = false;}else { Regex numRegex = new Regex(@"^(-?[0-9]*[.]*[0-9]*)$"); Match Result = numRegex.Match(Conv 阅读全文
posted @ 2011-05-04 08:44 Yao,Mane 阅读(330) 评论(0) 推荐(0) 编辑