主要對 多線程更新 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) {
新聞熱點
疑難解答
圖片精選