-
-
Microsoft CLR Debugger动态调试问题
-
发表于:
2008-12-21 20:33
7437
-
Microsoft CLR Debugger动态调试问题
.method private hidebysig instance void
'获取序列号'() cil managed
{
// Code size 58 (0x3a)
.maxstack 3
.locals init (class EMSWEB_Send.computer V_0)
IL_0000: newobj instance void EMSWEB_Send.computer::.ctor()
IL_0005: stloc.0
IL_0006: ldarg.0
IL_0007: ldfld class [System.Windows.Forms]System.Windows.Forms.TextBox EMSWEB_Send.reg::textBox1
IL_000c: ldloc.0
IL_000d: callvirt instance string EMSWEB_Send.computer::'机器序列号'()
IL_0012: ldstr "S"
IL_0017: call string [mscorlib]System.String::Concat(string,
string)
IL_001c: callvirt instance void [System.Windows.Forms]System.Windows.Forms.Control::set_Text(string)
IL_0021: ldarg.0
//=================================
运行到 IL_0021 时出现线程访问错误,说'textBox1' 被多个线程访问了,
晕,怎么会出现这种情况,请高人指点下,谢谢
An unhandled exception of type 'System.InvalidOperationException' occurred in System.Windows.Forms.dll
Additional information: Cross-thread operation not valid: Control 'textBox1' accessed from a thread other than the thread it was created on.
[注意]传递专业知识、拓宽行业人脉——看雪讲师团队等你加入!