Windows窗体进入无响应状态

Windows窗体进入无响应状态

本文介绍了Windows窗体进入无响应状态的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好。我在Windows窗体应用程序C#中有一个深嵌套循环(大约30深)。

当这个程序运行时,它进入Not Responding状态。我在64位机器上运行它。



Hi. I have a deep nested loop (about 30 deep) in windows form application C#.
when this program run,it goes into a Not Responding state. I am running this on a 64 bit machine.

if (c22.Any())
                                                                                                                                                                                            {
                                                                                                                                                                                                for (int a22 = 0; a22 < c22.Count(); a22++)
                                                                                                                                                                                                {
                                                                                                                                                                                                    if (c23.Any())
                                                                                                                                                                                                    {
                                                                                                                                                                                                        for (int a23 = 0; a23 < c23.Count(); a23++)
                                                                                                                                                                                                        {
                                                                                                                                                                                                            if (c24.Any())
                                                                                                                                                                                                            {
                                                                                                                                                                                                                for (int a24 = 0; a24 < c24.Count(); a24++)
                                                                                                                                                                                                                {
                                                                                                                                                                                                                    if (c25.Any())
                                                                                                                                                                                                                    {
                                                                                                                                                                                                                        for (int a25 = 0; a25 < c25.Count(); a25++)
                                                                                                                                                                                                                        {
                                                                                                                                                                                                                            if (c26.Any())
                                                                                                                                                                                                                            {
                                                                                                                                                                                                                                for (int a26 = 0; a26 < c26.Count(); a26++)
                                                                                                                                                                                                                                {
                                                                                                                                                                                                                                    if (c27.Any())
                                                                                                                                                                                                                                    {
                                                                                                                                                                                                                                        for (int a27 = 0; a27 < c27.Count(); a27++)
                                                                                                                                                                                                                                        {
                                                                                                                                                                                                                                            if (c28.Any())
                                                                                                                                                                                                                                            {
                                                                                                                                                                                                                                                for (int a28 = 0; a28 < c28.Count(); a28++)
                                                                                                                                                                                                                                                {
                                                                                                                                                                                                                                                    if (c29.Any())
                                                                                                                                                                                                                                                    {
                                                                                                                                                                                                                                                        for (int a29 = 0; a8 < c29.Count(); a29++)
                                                                                                                                                                                                                                                        {
                                                                                                                                                                                                                                                            richTextBox1.Text += c0[a0] + "," + c1[a1] + "," + c2[a2] + "," + c3[a3] + "," + c4[a4] + "," + c5[a5] + "," + c6[a6] + "," + c7[a7] + "," + c8[a8] + "," + c9[a9] + "," + c10[a10]
                                                                                                                                                                                                                                                                + c11[a11] + "," + c12[a12] + "," + c13[a13] + "," + c14[a14] + "," + c15[a15] + "," + c16[a16] + "," + c17[a17] + "," + c18[a18] + "," + c19[a19] + "," + c20[a20]
                                                                                                                                                                                                                                                                + c21[a21] + "," + c22[a22] + "," + c23[a23] + "," + c24[a24] + "," + c25[a25] + "," + c26[a26] + "," + c27[a27] + "," + c28[a28] + "," + c29[a29] + "\n";
                                                                                                                                                                                                                                                        }
                                                                                                                                                                                                                                                    }
                                                                                                                                                                                                                                                    else
                                                                                                                                                                                                                                                        richTextBox1.Text += c0[a0] + "," + c1[a1] + "," + c2[a2] + "," + c3[a3] + "," + c4[a4] + "," + c5[a5] + "," + c6[a6] + "," + c7[a7] + "," + c8[a8] + "," + c9[a9] + "," + c10[a10]
                                                                                                                                                                                                                                                                 + c11[a11] + "," + c12[a12] + "," + c13[a13] + "," + c14[a14] + "," + c15[a15] + "," + c16[a16] + "," + c17[a17] + "," + c18[a18] + "," + c19[a19] + "," + c20[a20]
                                                                                                                                                                                                                                                                 + c21[a21] + "," + c22[a22] + "," + c23[a23] + "," + c24[a24] + "," + c25[a25] + "," + c26[a26] + "," + c27[a27] + "," + c28[a28] + "\n";

                                                                                                                                                                                                                                                }
                                                                                                                                                                                                                                            }
                                                                                                                                                                                                                                            else
                                                                                                                                                                                                                                                richTextBox1.Text += c0[a0] + "," + c1[a1] + "," + c2[a2] + "," + c3[a3] + "," + c4[a4] + "," + c5[a5] + "," + c6[a6] + "," + c7[a7] + "," + c8[a8] + "," + c9[a9] + "," + c10[a10]
                                                                                                                                                                                                                                                                 + c11[a11] + "," + c12[a12] + "," + c13[a13] + "," + c14[a14] + "," + c15[a15] + "," + c16[a16] + "," + c17[a17] + "," + c18[a18] + "," + c19[a19] + "," + c20[a20]
                                                                                                                                                                                                                                                                 + c21[a21] + "," + c22[a22] + "," + c23[a23] + "," + c24[a24] + "," + c25[a25] + "," + c26[a26] + "," + c27[a27] + "\n";
                                                                                                                                                                                                                                        }

                                                                                                                                                                                                                                    }
                                                                                                                                                                                                                                    else
                                                                                                                                                                                                                                        richTextBox1.Text += c0[a0] + "," + c1[a1] + "," + c2[a2] + "," + c3[a3] + "," + c4[a4] + "," + c5[a5] + "," + c6[a6] + "," + c7[a7] + "," + c8[a8] + "," + c9[a9] + "," + c10[a10]
                                                                                                                                                                                                                                                                 + c11[a11] + "," + c12[a12] + "," + c13[a13] + "," + c14[a14] + "," + c15[a15] + "," + c16[a16] + "," + c17[a17] + "," + c18[a18] + "," + c19[a19] + "," + c20[a20]
                                                                                                                                                                                                                                                                 + c21[a21] + "," + c22[a22] + "," + c23[a23] + "," + c24[a24] + "," + c25[a25] + "," + c26[a26] + "\n";
                                                                                                                                                                                                                                }
                                                                                                                                                                                                                            }
                                                                                                                                                                                                                            else
                                                                                                                                                                                                                                richTextBox1.Text += c0[a0] + "," + c1[a1] + "," + c2[a2] + "," + c3[a3] + "," + c4[a4] + "," + c5[a5] + "," + c6[a6] + "," + c7[a7] + "," + c8[a8] + "," + c9[a9] + "," + c10[a10]
                                                                                                                                                                                                                                                                 + c11[a11] + "," + c12[a12] + "," + c13[a13] + "," + c14[a14] + "," + c15[a15] + "," + c16[a16] + "," + c17[a17] + "," + c18[a18] + "," + c19[a19] + "," + c20[a20]
                                                                                                                                                                                                                                                                 + c21[a21] + "," + c22[a22] + "," + c23[a23] + "," + c24[a24] + "," + c25[a25] + "\n";
                                                                                                                                                                                                                        }
                                                                                                                                                                                                                    }
                                                                                                                                                                                                                    else
                                                                                                                                                                                                                        richTextBox1.Text += c0[a0] + "," + c1[a1] + "," + c2[a2] + "," + c3[a3] + "," + c4[a4] + "," + c5[a5] + "," + c6[a6] + "," + c7[a7] + "," + c8[a8] + "," + c9[a9] + "," + c10[a10]
                                                                                                                                                                                                                                                                 + c11[a11] + "," + c12[a12] + "," + c13[a13] + "," + c14[a14] + "," + c15[a15] + "," + c16[a16] + "," + c17[a17] + "," + c18[a18] + "," + c19[a19] + "," + c20[a20]
                                                                                                                                                                                                                                                                 + c21[a21] + "," + c22[a22] + "," + c23[a23] + "," + c24[a24] + "\n";
                                                                                                                                                                                                                }

                                                                                                                                                                                                            }
                                                                                                                                                                                                            else
                                                                                                                                                                                                                richTextBox1.Text += c0[a0] + "," + c1[a1] + "," + c2[a2] + "," + c3[a3] + "," + c4[a4] + "," + c5[a5] + "," + c6[a6] + "," + c7[a7] + "," + c8[a8] + "," + c9[a9] + "," + c10[a10]
                                                                                                                                                                                                                                                                 + c11[a11] + "," + c12[a12] + "," + c13[a13] + "," + c14[a14] + "," + c15[a15] + "," + c16[a16] + "," + c17[a17] + "," + c18[a18] + "," + c19[a19] + "," + c20[a20]
                                                                                                                                                                                                                                                                 + c21[a21] + "," + c22[a22] + "," + c23[a23] + "\n";
                                                                                                                                                                                                        }
                                                                                                                                                                                                    }
                                                                                                                                                                                                    else
                                                                                                                                                                                                        richTextBox1.Text += c0[a0] + "," + c1[a1] + "," + c2[a2] + "," + c3[a3] + "," + c4[a4] + "," + c5[a5] + "," + c6[a6] + "," + c7[a7] + "," + c8[a8] + "," + c9[a9] + "," + c10[a10]
                                                                                                                                                                                                                                                                 + c11[a11] + "," + c12[a12] + "," + c13[a13] + "," + c14[a14] + "," + c15[a15] + "," + c16[a16] + "," + c17[a17] + "," + c18[a18] + "," + c19[a19] + "," + c20[a20]
                                                                                                                                                                                                                                                                 + c21[a21] + "," + c22[a22] + "\n";
                                                                                                                                                                                                }





What I have tried:



If i run it in multi thread, text of richTextBox will not true.



What I have tried:

If i run it in multi thread, text of richTextBox will not true.

推荐答案


这篇关于Windows窗体进入无响应状态的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-07 05:40