标签:cli 打开 method 命名空间 gevent threading abort button 文件
进程Process
通过进程打开一个应用程序或文件
调用命名空间:
using System.Diagnostics;
Process.Start("calc");
线程类:
using System.Threading;
Thread thread1; private void button1_Click(object sender, EventArgs e) { Control.CheckForIllegalCrossThreadCalls = false; thread1 = new Thread(Thread1_Method); thread1.IsBackground = true; thread1.Start(); } private void Thread1_Method() { int i = 0; while (true) { textBox1.Text = i.ToString(); i++; } } private void Form1_FormClosing(object sender, FormClosingEventArgs e) { thread1.Abort(); }
标签:cli 打开 method 命名空间 gevent threading abort button 文件
原文地址:https://www.cnblogs.com/LynnXue/p/12547716.html