-
Notifications
You must be signed in to change notification settings - Fork 0
/
PerfilNiñera.aspx.cs
57 lines (51 loc) · 1.66 KB
/
PerfilNiñera.aspx.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
public partial class PerfilNiñera : System.Web.UI.Page
{
public sql sql = new sql();
public int cant;
public void Page_Load(object sender, EventArgs e)
{
try
{
string rutNi = Request.QueryString["idN"].ToString();
}catch(Exception){}
}
public void mensajeAlerta(String texto)
{
String t = texto;
Page.ClientScript.RegisterStartupScript(this.GetType(), "Scripts", "<script>alert('" + t + "');</script>");
}
public string Url_Codificada(string cadena)
{
byte[] cadenaByte = new byte[cadena.Length];
cadenaByte = System.Text.Encoding.UTF8.GetBytes(cadena);
string encodedCadena = Convert.ToBase64String(cadenaByte);
return encodedCadena;
}
public string Url_Decodificada(string cadena)
{
var encoder = new System.Text.UTF8Encoding();
var utf8Decode = encoder.GetDecoder();
byte[] cadenaByte = Convert.FromBase64String(cadena);
int charCount = utf8Decode.GetCharCount(cadenaByte, 0, cadenaByte.Length);
char[] decodedChar = new char[charCount];
utf8Decode.GetChars(cadenaByte, 0, cadenaByte.Length, decodedChar, 0);
string result = new String(decodedChar);
return result;
}
protected void LinkButton2_Click(object sender, EventArgs e)
{
cant = 1;
mensajeAlerta("voto "+cant);
}
protected void LinkButton6_Click(object sender, EventArgs e)
{
cant = 2;
mensajeAlerta("voto "+cant);
}
}