Hi guys.
All in FORM1
Why when i do "socketConectado.close()" it shows me:Code:public partial class Form1 : Form { Thread thread; public Form1() { thread = new Thread(run); thread.Start(); } public void run() { ConectadoThread socketConectado = new ConectadoThread(); } private void Form1_FormClosing(object sender, FormClosingEventArgs e) { socketConectado.close(); } }
Thanks =)Error 2 The name 'socketConectado' does not exist in the current context C:\Users\Mauri\Desktop\Proyectos\Visual Studio 2008\Projects\WindowsFormsApplication3\WindowsFormsApplication3\Form1.cs
Edit: Solved, need to define the object outside the run method




Reply With Quote