TO:Samen168(Samen)主要是想说明我做的过程中所遇到的问题。多谢赐教!
解决方案 »
- 代码 实现office 2010 转换pdf格式
- 成为一个C#程序员都应该做什么?
- C# 页面按钮点击以后不触发后台事件.一般是出什么问题了?
- 尝试读取或写入受保护的内存,这通常指示其他内存已损坏?”。太难了,求助CSDN网友!
- 一段代码里的运算符看不懂。求解释。
- 急....在线等..在水晶报表时,去掉后面的零
- 泛型实现的二叉树,高人再来看看程序有什么问题,我调试不过去
- 来电弹屏
- 如何是应用程序启动后只显示为右下角的图标,就象NORTON那样。
- 高手进来看一看,微软专家请进来,关于datagrid控件的一些做的效果
- C#访问java的WebService不成功?
- 如何知道SqlCommand里的数据有多少个?
无限循环 至少也要写成
while(true)
{
Thread.Sleep(10); m_dResult += 13;
textBox_Result.Text = m_dResult.ToString();
}吧.
{
while(true)
{
Thread.Sleep(10);
m_dResult += 13;
textBox_Result.Text = m_dResult.ToString();
}
}
public void ThreadB()
{
while(true)
{
Thread.Sleep(10);
m_dResult -= 11;
textBox_Result.Text = m_dResult.ToString();
}
}
using System.Threading;namespace AutoResetEvent_Examples
{
class MyMainClass
{
//Initially not signaled.
const int numIterations = 100;
static AutoResetEvent myResetEvent = new AutoResetEvent(false);
static int number;
static void Main()
{
//Create and start the reader thread.
Thread myReaderThread = new Thread(new ThreadStart(MyReadThreadProc));
myReaderThread.Name = "ReaderThread";
myReaderThread.Start(); for(int i = 1; i <= numIterations; i++)
{
Console.WriteLine("Writer thread writing value: {0}", i);
number = i;
//Signal that a value has been written.
myResetEvent.Set();
//Give the Reader thread an opportunity to act.
Thread.Sleep(0);
} //Terminate the reader thread.
myReaderThread.Abort();
} static void MyReadThreadProc()
{
while(true)
{
//The value will not be read until the writer has written
// at least once since the last read.
myResetEvent.WaitOne();
Console.WriteLine("{0} reading value: {1}", Thread.CurrentThread.Name, number);
}
}
}
}