Esempio n. 1
0
 private void OnSend(IAsyncResult ar)
 {
     try
     {
         clientSocket.EndSend(ar);
         strName      = txtName.Text;
         DialogResult = DialogResult.OK;
         SGSClient frm = new SGSClient();
         frm.Text = txtName.Text;
         Close();
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message, "SGSclient", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
Esempio n. 2
0
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            LoginForm loginForm = new LoginForm();

            Application.Run(loginForm);
            if (loginForm.DialogResult == DialogResult.OK)
            {
                SGSClient sgsClientForm = new SGSClient();
                //sgsClientForm.clientSocket = loginForm.clientSocket; //Aqui le pasaba la referencia...
                //sgsClientForm.strName = loginForm.strName;

                sgsClientForm.ShowDialog();
            }
        }
Esempio n. 3
0
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            LoginForm loginForm = new LoginForm();

            Application.Run(loginForm);
            if (loginForm.DialogResult == DialogResult.OK)
            {
                SGSClient sgsClientForm = new SGSClient();
                sgsClientForm.clientSocket = loginForm.clientSocket;
                sgsClientForm.strName = loginForm.strName;

                sgsClientForm.ShowDialog();
            }
        }
Esempio n. 4
0
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            LoginForm loginForm = new LoginForm();

            Application.Run(loginForm);
            if (loginForm.DialogResult == DialogResult.OK)
            {
                SGSClient sgsClientForm = new SGSClient(loginForm.strName, loginForm.epServer);
                sgsClientForm.clientSocket = loginForm.clientSocket;
                sgsClientForm.strName      = loginForm.strName;
                sgsClientForm.epServer     = loginForm.epServer;

                sgsClientForm.ShowDialog();
            }
        }
 public SGSClient()
 {
     InitializeComponent();
     me = this;
     Program.client.ReceiveCallback = ProcessData();
 }