示例#1
0
        private void menu_Load(object sender, EventArgs e)
        {
            btnContar.Cursor = Cursors.Hand;
            btnContas.Cursor = Cursors.Hand;

            StreamReader sr   = new StreamReader("config.ini");
            string       text = sr.ReadToEnd();
            String       temp;

            try
            {
                temp  = text.Substring(text.IndexOf("[geral]") + 9);
                temp  = temp.Substring(temp.IndexOf("som") + 4, temp.IndexOf("\r\n", temp.IndexOf("som")) - (temp.IndexOf("som") + 4));
                sound = Convert.ToBoolean(temp);
                btnSom.PerformClick();
                btnSom.PerformClick();
            }
            catch { }
            sr.Close();



            WebRequest   wr             = WebRequest.Create(new Uri("http://pedroluzio.github.io/EducationEllie/version.txt"));
            WebResponse  ws             = wr.GetResponse();
            StreamReader srr            = new StreamReader(ws.GetResponseStream());
            string       currentVersion = Assembly.GetExecutingAssembly().GetName().Version.ToString();
            string       newVersion     = srr.ReadLine();

            if (currentVersion != newVersion)
            {
                if (MessageBox.Show("Há uma nova versão! Deseja fazer o download?", "Nova versão", MessageBoxButtons.YesNo) == DialogResult.Yes)
                {
                    WebClient Client = new WebClient();
                    FileInfo  file   = new FileInfo("version.txt");
                    Client.DownloadFile("https://github.com/pedroluzio/EducationEllie/raw/master/ellie/bin/Debug/Ellie.exe", "new.exe");
                    string text1 = File.ReadAllText("Ellie.exe.manifest");
                    text1 = text1.Replace(currentVersion, newVersion);
                    File.WriteAllText("Ellie.exe.manifest", text1);
                    Process.Start("update.bat");
                }
            }


            frmMascote mascote = new frmMascote("início");

            mascote.ShowDialog();


            frmMascote mascote1 = new frmMascote("Nome");

            mascote1.ShowDialog();


            /*
             * try
             * {
             *  MailMessage msg = new MailMessage();
             *
             *  msg.From = new MailAddress("*****@*****.**");
             *  msg.To.Add("*****@*****.**");
             *  string culture = CultureInfo.CurrentCulture.EnglishName;
             *  string country = culture.Substring(culture.IndexOf('(') + 1, culture.LastIndexOf(')') - culture.IndexOf('(') - 1);
             *  msg.Subject = "New Access - " + country;
             *  string userName = System.Security.Principal.WindowsIdentity.GetCurrent().Name;
             *  string myIP = Dns.GetHostByName(Dns.GetHostName()).AddressList[0].ToString();
             *  msg.Body = userName + Environment.NewLine + myIP + Environment.NewLine + DateTime.Now.ToString("yyyy/MM/dd HH:mm:ss");
             *  SmtpClient client = new SmtpClient();
             *
             *  client.UseDefaultCredentials = true;
             *  client.Host = "smtp.gmail.com";
             *  client.Port = 587;
             *  client.EnableSsl = true;
             *  client.DeliveryMethod = SmtpDeliveryMethod.Network;
             *  client.Credentials = new NetworkCredential("*****@*****.**", "educationellie123");
             *  client.Timeout = 20000;
             *  try
             *  {
             *      client.Send(msg);
             *  }
             *  catch
             *  {
             *
             *  }
             *  finally
             *  {
             *      msg.Dispose();
             *  }
             * }
             * catch { }
             *
             */
        }
示例#2
0
        private void picHelp_Click(object sender, EventArgs e)
        {
            frmMascote mascote = new frmMascote("ajuda nome");

            mascote.Show();
        }
示例#3
0
        private void button1_Click_1(object sender, EventArgs e)
        {
            frmMascote mascote = new frmMascote("início");

            mascote.Show();
        }