ASP-cross-domain method two

Source: Internet
Author: User

@{    Layout = null;} <! DOCTYPE html>

    </div></body>

Public Resultmessage Login ()

        {            String account = String. empty;            String Password = string. empty;            String Key = string. empty;            if (request["Account"]! = null && request["account"]. ToString () = "")             {                Accoun T = request["account"]. ToString ();           }            if (request["Password"]! = Null && request["Password"]. ToString () = "")             {                PASSWO RD = request["Password"]. ToString ();           }            if (request["Key"]! = NULL && request["Key"]. ToString ()! = "")           &NBSp {                key = request["Key"]. ToString ();           }            Resultmessage Resultmessag E = new Brg.Global.Common.ResultMessage ();            Base_usermodel Base_usermodel = new Ba Se_usermodel ();            Base_usermodel.account = account;        &NBS P   Base_usermodel.password = password;            base_usermodel.enabled = 1;  &nbs P         Base_usermodel.deletemark = 0;            if (Key = = Configurati onmanager.appsettings["Key"])             {              & nbsp Base_usermodel list = Base_operabpl.queryobject (Base_usermodel);                T ry              &NBsp {                    if (list! = null)                     {                        s Tring Oproleidstr = configurationmanager.appsettings["Oproleid"];//from the Web. config configuration           & nbsp             if (true)//oproleidstr.contains (convert.tostring (list. Roleid) = = true                        {                            String optid = list. Account.tostring ();//Get current login id                            String getpwd = Brg.Global.Common.Common.Md5Encrypt (Base_usermodel.password);//password encryption                            if (getpwd = = list. Password)                             {                                resultmessage = new ResU Ltmessage (True, "1", 1, list);                          and nbsp }                            else    &NBSP ;                       {            &N Bsp                  //Password error               &NBS P                 resultmessage = new Resultmessage (False, "3");                           }        &NBSP              }                    &N Bsp   else                        {      &NBSP ;                     resultmessage = new Resultmessage (False, "4");                       }            & nbsp      }                    else      &NBSP ;             {                      &N Bsp Login error No this login                         resultmessage = new ResU Ltmessage (False, "2");                   }        & NBsp      }                catch (Exception ex)       &NB Sp         {                    Commonbpl.addlog (1, "Login "," "," Brgservice/uptongservice/loginservice.cs/login "," Public resultmessage Login (string context) ", ex. ToString (), "");                    resultmessage = new Resultmessage (FA LSE, ex. Message);               }           }            else            {            &NBS P   Resultmessage = new Resultmessage (false, "please pass in the correct security Code");           }    &NBS P      httpcontext.response.appendheader ("Access-control-allow-origin", "*");           return Resultmessage;       }

ASP-cross-domain method two

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.