Exemplo n.º 1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        //if (!IsPostBack)
        //{
            string ola ="";

            documentos doc = new documentos();

            //Byte[] bytes = File.ReadAllBytes(@"D:\10_pagos\Respuesta Transferencia.pdf");
            //String file = Convert.ToBase64String(bytes);
            //double len = new FileInfo(@"D:\10_pagos\PSPsm.pdf").Length;

            //doc.insertar(file, "pdf", "Respuesta Transferencia1.pdf");

            var documento = doc.consultar("4D34CF82-F61A-47A6-B140-61F2F1988FB2");

            string path = @"D:\100_Cargues\";

            Byte[] bytess = Convert.FromBase64String(documento.contenido);

            File.WriteAllBytes(path + documento.nombre, bytess);

            //ServicioGestionUsuarios.GestionUsuarioClient sClient = new ServicioGestionUsuarios.GestionUsuarioClient();
            //sClient.validarUsuarios("diego", "mateo1987.");
           // DaoOperaciones a = new DaoOperaciones();
            //a.DeleteOperacionesPerfil("ADMIN", 4);
            //a.InsertarOperacionesPerfil("ADMIN", 4);

            DateTime result;
            CultureInfo provider = CultureInfo.InvariantCulture;
            string dateString = "Sun 15 Jun 2008 8:30 AM -06:00";
            string format = "ddd dd MMM yyyy h:mm tt zzz";
            try
            {
                result = DateTime.ParseExact(dateString, format, provider);
                Console.WriteLine("{0} converts to {1}.", dateString, result.ToString());
            }
            catch (FormatException)
            {
                Console.WriteLine("{0} is not in the correct format.", dateString);
            }
        //}
    }
Exemplo n.º 2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            if (Thread.CurrentPrincipal.Identity.IsAuthenticated)
            {
                documentos doc = new documentos();

                Byte[] bytes = File.ReadAllBytes(@"D:\datos.png");
                String file = Convert.ToBase64String(bytes);

               // doc.insertar(file, "png", "datos.png");

                string path = @"D:\100_Cargues\";

                var documento = doc.consultar("");

                Byte[] bytess = Convert.FromBase64String(documento.contenido);

                File.WriteAllBytes(path + documento.nombre, bytes);

                string usuarioActual = Thread.CurrentPrincipal.Identity.Name;

                MembershipUser u = Membership.GetUser(usuarioActual);
                if (u.LastPasswordChangedDate.Equals(u.CreationDate))
                {
                    Response.Redirect("../RestablecerContrasena/AsignarRespuestaSecretaContrasenia.aspx", true);
                }

            }
            else
            {
                Response.Redirect("../Logoff.aspx");
            }
        }
        catch (Exception ex)
        {

        }
    }