Ejemplo n.º 1
0
        private void Add_Butt_Click(object sender, RoutedEventArgs e)
        {
            var       pathWithEnv = @"%USERPROFILE%\Appdata\roaming";
            var       fileTXT     = Environment.ExpandEnvironmentVariables(pathWithEnv + @"\vddl\batchdown.txt");
            ArrayList BatchD      = new ArrayList();

            if (File.Exists(fileTXT))
            {
                BatchD.Add(Add_TXT.Text);
                string appTEXT = Add_TXT.Text;
                Add_TXT.Clear();
                ount++;
                string CaC = ount.ToString();
                OutBat_TXT.AppendText("\n" + CaC + ": " + appTEXT);
                File.AppendAllLines(fileTXT, BatchD.Cast <string>());
                OutBat_TXT.ScrollToEnd();
            }
            else
            {
                File.AppendAllText(fileTXT, "");
                BatchD.Add(Add_TXT.Text);
                string appTEXT = Add_TXT.Text;
                Add_TXT.Clear();
                ount++;
                string CaC = ount.ToString();
                OutBat_TXT.AppendText(ount + ": " + appTEXT);
                File.AppendAllLines(fileTXT, BatchD.Cast <string>());
                OutBat_TXT.ScrollToEnd();
            }

            //Use this on download button, separte.
            //File.WriteAllLines(fileTXT, BatchD.Cast<string>());
        }
Ejemplo n.º 2
0
        private void Clear_Bat_Butt_Click(object sender, RoutedEventArgs e)
        {
            var pathWithEnv = @"%USERPROFILE%\Appdata\roaming";
            var BatTXT      = Environment.ExpandEnvironmentVariables(pathWithEnv + @"\vddl\batchdown.txt");

            File.Delete(BatTXT);
            OutBat_TXT.Clear();
            ount = 0;
        }