在调试时挂起visual studio [英] hang up visual studio when debugging

查看:72
本文介绍了在调试时挂起visual studio的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好

我写了关于两个sin曲线之间的相似性的c#项目并没有任何错误并编译

但它不起作用我的表格挂起up!

i在我的表单中使用了3个函数,当点击一个按钮时它应该执行它们!

在我的函数中我使用了数组和集合(双列表)价值)

我应该上课吗????



请帮帮我



mu功能之一如下:





hello
I have written c# project about similarity between tow sin curve and it hasn't any error and compile
but it doesn't work and my form hang up!
i have used 3 function in my form and when click on one button it should execute them!
in my functions i have used array and the collection(list of double values)
should i use class ????

please help me

one of mu function is like below:


private void ASCI4(double[] x, int width)
     {
         double[] up = new double[width];
         double[] lp = new double[width];
         double[] ud = new double[width];
         double[] ld = new double[width];
         for(int i=0;i<width;i++)
         {
          up[i]=x[i]+0.25;
             UP.Add(up[i]);

          lp[i]=x[i]-0.25;
             LP.Add(lp[i]);

          ud[i]=x[i]+0.5;
             UD.Add(ud[i]);

          ld[i] = x[i] - 0.5;
              LD.Add(ld[i]);
         }
         foreach (double up1 in UP)
         {
             foreach (double ud1 in UD)
             {
                 foreach (double lp1 in LP)
                 {
                     foreach (double ld1 in LD)
                     {
                         foreach (Point v1 in V)
                         {
                             if ((v1.Y > lp1) & (v1.Y < up1))
                                 RP.Add(v1.Y);

                             else if ((v1.Y < ld1) | (v1.Y > ud1))
                                 RN.Add(v1.Y);
                             else if (((v1.Y >= ld1) & (v1.Y <= lp1)) | ((v1.Y >= up1) & (v1.Y <= ud1)))
                                 RZ.Add(v1.Y);
                         }
                     }
                 }
             }
         }
     }





添加了代码块 - OriginalGriff [/ edit]



[edit]Code block added - OriginalGriff[/edit]

推荐答案

你很惊讶?

我'我没有。



我不知道你在宽度中传递的是什么值,但是你接着继续进行嵌套循环,这将至少是内循环的宽度^ 5次迭代。 (可能更多,因为在添加新元素之前没有清除类级别列表,并且我们无法在V中看到元素的数量)因此,如果宽度为5,那么内部循环执行3125次。如果它是20,那么它是3,200,000次,等等,每次都将元素添加到列表中...



你的表格什么都不做所有迭代都完成了。你可以采取一些措施来防止这种情况发生,但首先我认为你需要看看这个并确定你是否真的想要这样做......





再一个问题

如何将文本框值从一个表单发送到另一个表单并将tetbox值分配给一个变量???
< br $>




取决于表格之间的关系。

你不发送文本框,你发送文本属性字符串,让另一个表单决定如​​何处理它。

看看这些:其中一个将描述关系并解释该怎么做。

在两个表单之间传输信息,第1部分:父母对孩子 [ ^ ]

在两种形式之间传递信息,第2部分:儿童到父母 [ ^ ]

在两种表格之间转移信息,第3部分:儿童与儿童 [ ^ ]
You are surprised?
I'm not.

I don't know what value you are passing through as the width, but you then proceed to nest loops that will be at least width^5 iterations of the inner loop. (More, probably, since you don't clear your class level lists before you add new elements, and we can't see the number of elements in V) So, if your width is 5, then your inner loop is executed 3125 times. If it is 20, then it;'s 3,200,000 times round, and so forth, each time adding elements to a list...

Your form will do nothing until all iterations are complete. There are things you can do to prevent that, but first I think you need to look at this and work out if that is what you actually intended...


"onemore question
how can i send a textbox value from one form to another form and assign tetbox value to one variable???"



Depends on the relationship between the forms.
You don't send the textbox, you send the Text property string and let the other form decide what to do with it.
Have a look at these: one of them will describe the relationship and explain what to do.
Transferring information between two forms, Part 1: Parent to Child[^]
Transferring information between two forms, Part 2: Child to Parent[^]
Transferring information between two forms, Part 3: Child to Child[^]


这篇关于在调试时挂起visual studio的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆