Pregunta

.NET 1.1 carece de ParameterizedThreadStart (Tengo que usar 1.1 porque es el último que admite NT 4.0)

En .NET 2.0, simplemente escribiría:

Thread clientThread = new Thread(new ParameterizedThreadStart(SomeThreadProc));
clientThread.Start(someThreadParams);

¿Cómo puedo crear un código .NET 1.1 equivalente?

¿Fue útil?

Solución

Debería crear una clase para el estado:

class Foo {
  private int bar;
  public Foo(int bar) { // and any other args
      this.bar = bar;
  }    
  public void DoStuff() {
     // ...something involving "bar"
  } 
}
...
Foo foo = new Foo(12);
Thread thread = new Thread(new ThreadStart(foo.DoStuff));
thread.Start();
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top