摘要:
public string UtfEncode(string str) { byte[] buffer = Encoding.GetEncoding("UTF-8").GetBytes(str); string result = ""; for (int i = 0; i < buffer.Length; i++) { result = result + "%" + buffer[i].ToString("x"); } return result; } 阅读全文
摘要:
private void btnCalculate_Click(object sender, EventArgs e) { Thread mythread = new Thread(Calculate); mythread.IsBackground = true; //設置為後臺線程,程式關閉后進程也關閉,如果不設置true,則程式關閉,此線程還在內存,不會關閉 mythread.Start(); } private void Calculate() { ... 阅读全文