Click here to Skip to main content
15,889,096 members
Please Sign up or sign in to vote.
2.00/5 (1 vote)
See more:
Plz provide a solution for above problem occuered while developing phone app

code:
C#
try
{
    if (!string.IsNullOrWhiteSpace(txtEmailId.Text))
    {
        string _userId = txtEmailId.Text;
        if (Regex.IsMatch(_userId, @"^(?("")("".+?(?<!\\)""@)|(([0-9a-z]((\.(?!\.))|[-!#\$%&'\*\+/=\?\^`\{\}\|~\w])*)(?<=[0-9a-z])@))" +
    @"(?(\[)(\[(\d{1,3}\.){3}\d{1,3}\])|(([0-9a-z][-\w]*[0-9a-z]*\.)+[a-z0-9][\-a-z0-9]{0,22}[a-z0-9]))$", RegexOptions.IgnoreCase))
        {
            if (!string.IsNullOrWhiteSpace(txtPassword.Password))
            {
                string _password = txtPassword.Password;
                requestUri = objHttpHelper.login_url;
                requestUri = string.Format(requestUri, _userId, _password);
                uri = new Uri(requestUri);
                response = await httpClient.GetAsync(uri);
                string strResponse = await response.Content.ReadAsStringAsync();

                LoginDetails loginDetails = JsonConvert.DeserializeObject<logindetails>(strResponse);
                           

                IList<error> err = loginDetails.Error;

                if (loginDetails.status_message == "Valid" && loginDetails.status_code == "1")
                {
                    ApplicationState.SetValue("EmailId", _userId);
                    ApplicationState.SetValue("UserID", loginDetails.userId);
                    ApplicationState.SetValue("SessionId", loginDetails.sessionId);
                    ApplicationState.SetValue("Password", _password);
                    httpClient.Dispose();
                    Frame.Navigate(typeof(Home));
                }
else
{}
catch(Exception e)
{}
Posted
Updated 28-Jan-15 1:52am
v2
Comments
CHill60 28-Jan-15 8:23am    
Where is the failure and what is the full message?
Sergey Alexandrovich Kryukov 28-Jan-15 12:07pm    
...and comprehensive exception information, especially type and the place in code where it's thrown.

Don't block propagation of exceptions as you do!

—SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900