Estimados.
Intento lanzar un thread cuyo metodo recibe dos parametros tipo string.
El echo es que el compilador me marca la linea como erronea.
El codigo del metodo es el siguiente el siguiente
private void ThreadMethodMTNuevos(string url, string posturl)
{
Encoding encode = Encoding.GetEncoding("ISO-8859-1");
byte[] byteArray = Encoding.Default.GetBytes(MT_postUrl);
// 'ContentType' property of the 'HttpWebRequest' class is set to
"application/x-www-form-urlencoded".
request.ContentType="application/x-www-form-urlencoded";
// 'ContentLength' property is set to Length of the data to be posted.
request.ContentLength=byteArray.Length;
Stream newStream = request.GetRequestStream();
newStream.Write(byteArray,0,byteArray.Length);
newStream.Close();
// Genero un response para obtener la respuesta desde la URL llamada
HttpWebResponse response = (HttpWebResponse)request.GetResponse();
Stream respuesta = response.GetResponseStream();
StreamReader readRespuesta = new StreamReader(respuesta, encode);
resp = readRespuesta.ReadLine() + readRespuesta.ReadLine();
response.Close();
return resp;
}
Y la llamada al metodo la hago de esta manera
Thread newThreadMTNuevos = new Thread(new
ThreadStart(ThreadMethodMTNuevos(url, posturl)));
newThreadMTNuevos.Start();
Y el error que me da es el siguiente "Se Esperaba un Nombre de Metodo"
El que me pueda dar una mano desde ya mucha gracias.
Federico
Leer las respuestas