-3

一个类示例:此代码中的 testHTTP.class

        public String httptest(object httptestx)
        {
         var data = (Tuple<string, string, string>)httptestx;
         var s = data.Item1;
         var k = data.Item2;
         var p = data.Item3;        
         ............................

        }

Form1 线程类未启动请帮助我...:

   private void button5_Click(object sender, EventArgs e)
    {
                for (Int32 i5 = 0; i5 < textBox5.Lines.Length; i5++)
                {
                    var thr1 = new Thread(dfproJesiHttpClass.httptest());
                    var data = new Tuple<string, string, string>(textBox6.Lines[i6].Trim(), textBox4.Lines[i4].Trim(), textBox5.Lines[i5].Trim());
                    thr1.Start(data);
                    threads.Add(thr1);
                }
    }
4

1 回答 1

2

如果该代码编译,我会感到惊讶。您需要更改此行:

var thr1 = new Thread(dfproJesiHttpClass.httptest());

var thr1 = new Thread(dfproJesiHttpClass.httptest);

假设这dfproJesiHttpClass是一个实例而不是类的名称。

于 2013-09-21T23:38:40.977 回答