예제 #1
0
        public static void sendActivationCode(int pin, string email)
        {
            var config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);

            path = config.AppSettings.Settings["email_path_activation_code"].Value;
            if (File.Exists(path))
            {
                text = File.ReadAllText(path);
                var zeilen = File.ReadLines(path);
                mail.Subject = zeilen.First();
                mail.To.Add(email);
                text      = text.Replace("%code%", pin.ToString());
                text      = text.Replace(zeilen.First(), " ");
                mail.Body = text;
                try
                {
                    client.Send(mail);
                }
                catch (Exception ex)
                {
                    Control_Icon.showMessage(500, "Projektarbeit TCP Server", ex.Message, ToolTipIcon.Error);
                }
            }
            else
            {
                Control_Icon.showMessage(500, "Projektarbeit TCP Server", "Die HTML Datei der Registration EMail wurde nicht gefunden", ToolTipIcon.Error);
                return;
            }
        }
예제 #2
0
        static void Main()
        {
            //bekommen
            Control_Icon.init();

            SQLManager.init();

            TCP_Server.start();

            Mail_Server.init();

            Tempsave.init();



            Application.Run();
        }