主要对 多线程更新 winform 不是特别清楚,绕来绕去,搞得很晕乎,主要代码如下, 还请各位大侠多多指点,谢谢!
代码如下:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Security.Cryptography;
using System.IO;
using System.Threading;
namespace FileMD5 {
public partial class MainForm : Form {
public MainForm() {
InitializeComponent();
}
private void button_file_Click(object sender, EventArgs e) {
OpenFileDialog fileDialog = new OpenFileDialog();
fileDialog.Title = "请选择文件";
fileDialog.RestoreDirectory = true;
if (fileDialog.ShowDialog() == DialogResult.OK) {
textBox_file.Text = fileDialog.FileName;
textBox_result.Text = "";
FileInfo file = new FileInfo(fileDialog.FileName);
fileSzie = file.Length;
showFilesize(fileSzie);
}
}
private void button_exit_Click(object sender, EventArgs e) {
this.Close();
this.Dispose();
}
private void button_check_Click(object sender, EventArgs e) {
checkResult();
}
MD5 md5 = (MD5)CryptoConfig.CreateFromName("MD5");
long fileSzie = 0;
private void button_calc_Click(object sender, EventArgs e) {
新闻热点
疑难解答
图片精选