110,533
社区成员
发帖
与我相关
我的任务
分享
do
{
sRet = WriteWalletInfo(ref CardBurseInfo, nCurCard, iWalletNum, dMonDeal, "11", out sErrText);
if (!sRet)
{
lb_Msg.Text = "写卡失败,请重试!";
}
}
while (!sRet);
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Threading;
namespace TestWaitNotify {
public partial class Form1 : Form {
private Thread thread = null;
private bool running = false;
public Form1() {
InitializeComponent();
}
private void execute() {
running = true;
int i = 0;
while (running) {
Console.WriteLine("执行操作 " + ++i + " ……");
}
Console.WriteLine("完成 ……");
thread = null;
}
private void btnStart_Click(object sender, EventArgs e) {
if (thread == null) {
thread = new Thread(new ThreadStart(this.execute));
thread.Start();
}
}
private void btnStop_Click(object sender, EventArgs e) {
running = false;
}
}
}