<script type= "Text/javascript" >function btnTest_Click () {$.ajax ({type: "POST", URL: "Authentication",// ContentType: "Application/text", DataType: "Text", data: {k: ' Cuw0k3vbly81dctluvdvzlf6dzvpzkvweudhuve5us9omkdqnwltdwmza1dczzn2rdzds0vpdmk2tnl3shiyb2vlzjd1cex1eitqzfvzv0mzbfnkruvhagxwm Utjzg9zau1hvkzmaxniqja9 '},success:function (Result) {alert ("1"), alert (RESULT.D),},error:function () {alert ("Access failed! ");}});/ /$.post ("Authentication", {k: ' Cuw0k3vbly81dctluvdvzlf6dzvpzkvweudhuve5us9omkdqnwltdwmza1dczzn2rdzds0vpdmk2tnl3shiyb2vlzjd1cex1eitqzfvzv0mzbfnkruvhagxwm Utjzg9zau1hvkzmaxniqja9 '},//function (data) {//alert (data);//},//"text");} </script>
protected void Page_Load (object sender, EventArgs e) {try {if (! IsPostBack) {if (request.form["k"] = = null) { Response.Write ("fail"); Return } string strk = request.form["K"]; byte[] bytes = convert.frombase64string (STRK); String streinput = System.Text.Encoding.UTF8.GetString (bytes); WebTools.Encode.GetPass GP = new WebTools.Encode.GetPass (); String strdinput = GP. Decodepass (Streinput); string[] Arrypar = Strdinput.split (';'); String strusernameinfo = Arrypar[0]; String strketangidinfo = Arrypar[1]; String strtstimeinfo = Arrypar[2]; Verify that the user is logged in Editorauth ea = new Editorauth (); BOOL Bislogin = ea.Checkuserislogined (); if (!bislogin) {Response.Write ("fail"); Return }//Verify that the class ID is valid and has purchased string zhibo_ketangid = System.Configuration.ConfigurationMan Ager. appsettings["Zhibo_ketangid"]; string[] Arryketangid = Strketangidinfo.split (': '); String strketangid = Arryketangid[1]; if (zhibo_ketangid! = Strketangid) {Response.Write ("fail"); Return } string zhibo_isbuy = system.configuration.configurationmanager.appsettings["Zhibo_isbuy"]; if (zhibo_isbuy! = "1") {Response.Write ("fail"); Return } Response.Write ("Pass"); Return Content ("fail"); }} catch (Exception ex) {Response.Write (ex). Message); } }
jquery Ajax Access aspx