示例#1
0
 private void Tmp_FormClosing(object sender, FormClosingEventArgs e)
 {
     startupMessage = !(sender as Startup).chkDontShow.Checked;
     if (!startupMessage)
     {
         DiceBot.Settings tmpSet = new Settings(this);
         tmpSet.chkStartup.Checked = startupMessage;
         writesettings(tmpSet);
         tmpSet.Dispose();
     }
 }
示例#2
0
        void writesettings(Settings TmpSet)
        {
            using (StreamWriter sw = new StreamWriter(Environment.GetEnvironmentVariable("APPDATA") + "\\DiceBot2\\Psettings"))
            {
                sw.WriteLine("new");
                string temp2 = TmpSet.txtJDUser.Text + "," + TmpSet.txtJDPass.Text + ",";
                if (TmpSet.chkJDAutoLogin.Checked)
                    temp2 += "1,";
                else temp2 += "0";
                if (TmpSet.chkJDAutoStart.Checked)
                    temp2 += "1,";
                else temp2 += "0";
                string jdline = "";

                foreach (char c in temp2)
                {
                    jdline += ((int)c).ToString(System.Globalization.NumberFormatInfo.InvariantInfo) + " ";
                }
                sw.WriteLine(jdline);

                ////tray,botname,enableemail,emailaddress,emailwithdraw,emailinvest,emaillow,emailstreak,emailstreakval
                string msg = "";
                msg = (TmpSet.chkTray.Checked) ? "1" : "0";
                sw.WriteLine("tray|"+msg);
                sw.WriteLine("botname|" + TmpSet.txtBot.Text);
                msg = (TmpSet.chkEmail.Checked) ? "1" : "0";
                sw.WriteLine("enableemail|"+msg);
                sw.WriteLine("emailaddress|" + TmpSet.txtEmail.Text);
                msg = (TmpSet.chkEmailWithdraw.Checked) ? "1" : "0";
                sw.WriteLine("emailwithdraw|"+msg);
                msg = (TmpSet.chkEmailLowLimit.Checked) ? "1" : "0";
                sw.WriteLine("emaillow|"+msg);
                msg = (TmpSet.chkEmailStreak.Checked) ? "1" : "0";
                sw.WriteLine("emailstreak|"+msg);
                sw.WriteLine("emailstreakval|" + TmpSet.nudEmailStreak.Value.ToString(System.Globalization.NumberFormatInfo.InvariantInfo));
                if (Emails == null)
                {
                    Emails = new Email("","");
                    Emails.SMTP = "emails11.secureserver.net";
                }
                sw.WriteLine("SMTP|" + Emails.SMTP);

                ////soundcoin,soundalarm,soundlower,soundstrea,soundstreakvalue

                msg = (TmpSet.chkSoundWithdraw.Checked) ? "1" : "0";
                sw.WriteLine("CoinEnabled|" + msg);
                sw.WriteLine("CoinPath|" + TmpSet.txtPathChing.Text);
                msg = (TmpSet.chkAlarm.Checked) ? "1" : "0";
                sw.WriteLine("AlarmEnabled|" + msg);
                msg = (TmpSet.chkSoundLowLimit.Checked) ? "1" : "0";
                sw.WriteLine("AlarmLowEnabled|" + msg);
                msg = (TmpSet.chkSoundStreak.Checked) ? "1" : "0";
                sw.WriteLine("AlarmStreakEnabled|" + msg);

                sw.WriteLine("AlarmStreakValue|" + TmpSet.nudSoundStreak.Value.ToString(System.Globalization.NumberFormatInfo.InvariantInfo));
                sw.WriteLine("AlarmPath|" + TmpSet.txtPathAlarm.Text);

                sw.WriteLine("AutoGetSeed|"+ (autoseeds?"1":"0"));
                sw.WriteLine("NumLiveBets|" + TmpSet.nudLiveBetsNum.Value);

                sw.WriteLine("DonatePercentage|" +TmpSet.nudDonatePercentage.Value );
                sw.WriteLine("StartupMessage|" + (TmpSet.chkStartup.Checked?"1":"0"));
                sw.WriteLine("DonateMode|"+ (TmpSet.rdbDonateDont.Checked?"1":TmpSet.rdbDonateDefault.Checked?"2":"3"));

            }
        }
示例#3
0
        void writesettings(Settings TmpSet)
        {
            using (StreamWriter sw = new StreamWriter(Environment.GetEnvironmentVariable("APPDATA") + "\\DiceBot2\\Psettings"))
            {
                sw.WriteLine("new");
                string temp2 = TmpSet.txtJDUser.Text + "," + TmpSet.txtJDPass.Text + ",";
                if (TmpSet.chkJDAutoLogin.Checked)
                    temp2 += "1,";
                else temp2 += "0";
                if (TmpSet.chkJDAutoStart.Checked)
                    temp2 += "1,";
                else temp2 += "0";
                string jdline = "";

                foreach (char c in temp2)
                {
                    jdline += ((int)c).ToString() + " ";
                }
                sw.WriteLine(jdline);

                ////tray,botname,enableemail,emailaddress,emailwithdraw,emailinvest,emaillow,emailstreak,emailstreakval
                string msg = "";
                msg = (TmpSet.chkTray.Checked) ? "1" : "0";
                sw.WriteLine("tray|"+msg);
                sw.WriteLine("botname|" + TmpSet.txtBot.Text);
                msg = (TmpSet.chkEmail.Checked) ? "1" : "0";
                sw.WriteLine("enableemail|"+msg);
                sw.WriteLine("emailaddress|" + TmpSet.txtEmail.Text);
                msg = (TmpSet.chkEmailWithdraw.Checked) ? "1" : "0";
                sw.WriteLine("emailwithdraw|"+msg);
                msg = (TmpSet.chkEmailLowLimit.Checked) ? "1" : "0";
                sw.WriteLine("emaillow|"+msg);
                msg = (TmpSet.chkEmailStreak.Checked) ? "1" : "0";
                sw.WriteLine("emailstreak|"+msg);
                sw.WriteLine("emailstreakval|" + TmpSet.nudEmailStreak.Value.ToString());
                sw.WriteLine("SMTP|" + Emails.SMTP);

                ////soundcoin,soundalarm,soundlower,soundstrea,soundstreakvalue

                msg = (TmpSet.chkSoundWithdraw.Checked) ? "1" : "0";
                sw.WriteLine("CoinEnabled|" + msg);
                sw.WriteLine("CoinPath|" + TmpSet.txtPathChing.Text);
                msg = (TmpSet.chkAlarm.Checked) ? "1" : "0";
                sw.WriteLine("AlarmEnabled|" + msg);
                msg = (TmpSet.chkSoundLowLimit.Checked) ? "1" : "0";
                sw.WriteLine("AlarmLowEnabled|" + msg);
                msg = (TmpSet.chkSoundStreak.Checked) ? "1" : "0";
                sw.WriteLine("AlarmStreakEnabled|" + msg);

                sw.WriteLine("AlarmStreakValue|" + TmpSet.nudSoundStreak.Value.ToString());
                sw.WriteLine("AlarmPath|" + TmpSet.txtPathAlarm.Text);

                sw.WriteLine("AutoGetSeed|"+ (autoseeds?"1":"0"));
                sw.WriteLine("NumLiveBets|" + TmpSet.nudLiveBetsNum.Value);

            }
        }