private void timer1_Tick(object sender, EventArgs e) { if (remoteObj != null) { label1.Text = "Client id: " + RemotingClient.frmLogin.BaseInfo.ClientId.ToString(); if (remoteObj.CheckSrvReady() && RemotingClient.frmLogin.BaseInfo.ClientId != 0) { if (remoteObj.CheckSrvReady()) { string task = remoteObj.GetTaskFromSvr(); int taskLenght = task.Length; int a = 0; int b = 0; string numS = ""; int numParsed = 0; int numInt = 0; char c = '_'; for (int i = 0; i < taskLenght; i++) { c = task[i]; if (c != ' ') { numS = numS + c; } else { numParsed++; numInt = Int32.Parse(numS); if (numParsed == 1) { a = numInt; } if (numParsed == 2) { b = numInt; } numS = ""; } } remoteObj.SendSolutionToSvr(findsol(a, b)); label3.Text = findsol(a, b).ToString(); } } } }