protected void btnLicense_Click(object sender, EventArgs e) { Client client = new Client(); RealLicense obj = new RealLicense(); obj.LicenseNumber = "JJ00131289"; client.sendAuthenticationRequest(obj); Session["User"] = client.receiveAuthenticationResponse(); if (((Boolean)Session["User"] == true)) { Response.Redirect("~/Success.aspx"); } else { Response.Redirect("~/Expired.aspx"); } }
public void sendAuthenticationRequest(RealLicense obj) { try { BinaryFormatter formatter = new BinaryFormatter(); formatter.AssemblyFormat = FormatterAssemblyStyle.Simple; formatter.Serialize(output, obj); } catch (Exception ex) //if failed to communicate with server { throw ex; } }