Esempio n. 1
0
        public void CreameEsta(string email, string nombreinv, string nombreev, string emailor, string asunto, int ast, int mast, int dast, int hast, int mnast, int sast, int aed, int med, int ded, int hed, int mned, int sed)
        {
            Fechas f = new Fechas();
            //especifico en windows
            //string lugar = @"C:\Users\ceflor\Documents\";
            //mac y windows
            string lugar = "./evento/";

            System.IO.Directory.CreateDirectory(lugar);
            string nombre = "prueba" + DateTime.Now.ToString("ddMMyyyyss") + ".ics";

            lugar = System.IO.Path.Combine(lugar, nombre);
            using (System.IO.StreamWriter mylogs = System.IO.File.AppendText(lugar))
            {
                String ics = @"BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//hacksw/handcal//NONSGML v1.0//EN
BEGIN:VEVENT
UID:" + email +
                             "\nDTSTAMP:" + f.Ahorawey() +
                             "\nORGANIZER; CN=" + nombreev + ":MAILTO:" + emailor +
                             "\nDTSTART:" + f.Regresameesta(ast, mast, dast, hast, mnast, sast) +
                             "\nDTEND:" + f.Regresameesta(aed, med, ded, hed, mned, sed) +

                             "\nSUMMARY:" + asunto +
                             "\nGEO:" + "25.6534664;-100.3407974" +
                             "\nEND:VEVENT" +
                             "\nEND:VCALENDAR";
                mylogs.WriteLine(ics);
                mylogs.Close();
            }
            Console.Write("\n------------------- \n");
            email mail = new email(email, nombreinv, emailor, nombre, nombreev);

            Console.Write("correo enviado");
        }
Esempio n. 2
0
        static void Main(string[] args)
        {
            Fechas f = new Fechas();

            Console.Write("Introduce email del invitado");
            string emailid = Console.ReadLine();

            Console.Write("Nombre del invitado");
            string nameinv = Console.ReadLine();

            Console.Write("\nNombre de organizador");
            string nombreorg = Console.ReadLine();

            Console.Write("\nEmail de organizador");
            string tuEmail = Console.ReadLine();


            Console.Write("\nAño inicio");
            int anoin = Convert.ToInt16(Console.ReadLine());

            Console.Write("\nmes inicio");
            int mesin = Convert.ToInt16(Console.ReadLine());

            Console.Write("\nDia inicio");
            int diain = Convert.ToInt16(Console.ReadLine());

            Console.Write("\nHora inicio 0-23");
            int horain = Convert.ToInt16(Console.ReadLine());

            Console.Write("\nMinutos inicio 0-59");
            int minin = Convert.ToInt16(Console.ReadLine());

            Console.Write("\nSegundos inicio 0-59");
            int segin = Convert.ToInt16(Console.ReadLine());

            Console.Write("\nAño fin");
            int anofin = Convert.ToInt16(Console.ReadLine());

            Console.Write("\nmes fin");
            int mesfin = Convert.ToInt16(Console.ReadLine());

            Console.Write("\nDia fin");
            int diafin = Convert.ToInt16(Console.ReadLine());

            Console.Write("\nHora fin 0-23");
            int horafin = Convert.ToInt16(Console.ReadLine());

            Console.Write("\nMin fin 0-59");
            int minfin = Convert.ToInt16(Console.ReadLine());

            Console.Write("\nSegundo fin 0-59");
            int segfin = Convert.ToInt16(Console.ReadLine());

            Console.Write("\nAsunto no max-60");
            string asunto = Console.ReadLine();

            CrearICS cr = new CrearICS();

            cr.CreameEsta(emailid, nameinv, nombreorg, tuEmail, asunto, anoin, mesin, diain, horain, minin, segin, anofin, mesfin, diafin, horafin, minfin, segfin);
            Console.Write("------------------- \n");
            Console.Write("se creo archivo");
            Console.Write("\n------------------- \n");
            Console.ReadKey();
        }