Exemplo n.º 1
0
Arquivo: cp.cs Projeto: ozotony/patent
    protected void Save_Click(object sender, EventArgs e)
    {
        string path = serverpath + @"\Handlers\bf.pke";

        if (File.Exists(path))
        {
            StreamReader reader = new StreamReader(path, true);
            file_string = reader.ReadToEnd();
            reader.Close();
            if (file_string != null)
            {
                string oldValue = file_string.Substring(0, file_string.IndexOf("</BitStrength>") + 14);
                file_string = file_string.Replace(oldValue, "");
            }
        }
        if (xnewpass1.Text != "")
        {
            xnewpass1_text = xnewpass1.Text;
        }
        if (xnewpass2.Text != "")
        {
            xnewpass2_text = xnewpass2.Text;
        }
        if (Session["Newpass"] != null)
        {
            xnewpass1_text = Session["Newpass"].ToString();
        }
        if (z.e_xadminz(adminID, ody.EncryptString(xnewpass1_text, file_len, file_string)) != "0")
        {
            Response.Redirect("./login.aspx");
        }
        else
        {
            Response.Redirect("./cp.aspx");
        }
    }