|
Llamar a un metodo en un Thread |
|
|
Escrito por Marcos
|
|
Lunes, 21 de Diciembre de 2009 20:00 |
|
Para cargar o llamar a un mentodo en un thread pueden ocurrir 2 cosas:
-Que el metodo al que llamemos no tenga parámetros
ThreadStart _ts = new ThreadStart(NombreDelMetodo);
Thread th = new Thread(_ts);
th.Start();
-Que el método al que llamemos tenga parámetros
ThreadStart _ts = delegate { NombreDelMetodo(argumento1, argumento2); };
Thread th = new Thread(_ts);
th.Start();
|
|
Última actualización el Lunes, 21 de Diciembre de 2009 20:06 |