private void GetResponseCallback(IAsyncResult asynchronousResult) { HttpWebRequest request = (HttpWebRequest)asynchronousResult.AsyncState; HttpWebResponse response = (HttpWebResponse)request.EndGetResponse(asynchronousResult); Stream streamResponse = response.GetResponseStream(); StreamReader streamRead = new StreamReader(streamResponse); string responseString = streamRead.ReadToEnd(); MemoryStream ResMs = new MemoryStream(Encoding.UTF8.GetBytes(responseString)); DataContractJsonSerializer ser = new DataContractJsonSerializer(typeof(Pos_Silverlight.DataContract.Response)); Pos_Silverlight.DataContract.Response _ResLogIn = (Pos_Silverlight.DataContract.Response)ser.ReadObject(ResMs); if (_ResLogIn.Code == "1") { //I am getting Error Hear Only Home obj = new Home(); this.Content = obj; } else { MessageBox.Show("InValied UserName and PassWord"); return; } streamResponse.Close(); streamRead.Close(); response.Close(); }
Invoke(new MethodInvoker(delegate { // Your code }));
BeginInvoke and EndInvoke
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)