Exemple #1
0
 public void Logout()
 {
     try
     {
         _ID = "";
         _Username = "";
         Settings settings = new Settings();
         settings.Username = "";
         settings.Password = "";
         settings.Save();
     }
     catch { }
 }
Exemple #2
0
 private void login_DoWork(object sender, DoWorkEventArgs e)
 {
     Settings settings = new Settings();
     if (settings.isAuthSet) Log.AuthenticateFull(settings.Username, settings.Password);
 }
Exemple #3
0
 public void AuthenticateFull(string username, string password)
 {
     string a = Authenticate(username, password);
     if (a == "")
     {
         Settings settings = new Settings();
         settings.Username = username;
         settings.Password = password;
         settings.Save();
         _Username = txt_luser.Text;
     }
     else
     {
         //u - Username does not exist
         //p - Password is incorrect
         //pl - Password not entered
         //ul - Username not entered
         if (a == "u" || a == "ul") MessageBox.Show("Username does not exist!", "Login Error");
         else if (a == "p") MessageBox.Show("Password is incorrect!", "Login Error");
         else if (a == "pl") MessageBox.Show("Please enter a password", "Login Error");
         else if (a == "fail") MessageBox.Show("We broke something, try again in a few minutes.", "Login Error");
         else MessageBox.Show(a, "DankWire Message");
     }
 }
Exemple #4
0
 private void cleanUpFiles(string filename, AV type)
 {
     Settings settings = new Settings();
     try
     {
         if (type == AV.MP3)
         {
             if (File.Exists(settings.DownloadPath + "\\" + safeFilename(fName) + ".mp3")) File.Delete(settings.DownloadPath + "\\" + safeFilename(fName) + ".mp3");
             if (File.Exists("Active/" + filename + ".mp4")) File.Delete("Active/" + filename + ".mp4");
             File.Move("Downloads/" + filename + ".mp3", settings.DownloadPath + "\\" + safeFilename(fName) + ".mp3");
         }
         else if (type == AV.Video)
         {
             File.Move("Active/" + filename + ".mp4", settings.DownloadPath + "\\" + safeFilename(fName) + ".mp4");
         }
     }
     catch { }
 }
Exemple #5
0
 private void bt_odf_Click(object sender, EventArgs e)
 {
     Settings settings = new Settings();
     string myDocspath = settings.DownloadPath;
     string windir = Environment.GetEnvironmentVariable("WINDIR");
     System.Diagnostics.Process prc = new System.Diagnostics.Process();
     prc.StartInfo.FileName = windir + @"\explorer.exe";
     prc.StartInfo.Arguments = myDocspath;
     prc.Start();
 }
Exemple #6
0
        private void bt_cdf_Click(object sender, EventArgs e)
        {
            Settings settings = new Settings();
            dirBrowse.SelectedPath = settings.DownloadPath;
            DialogResult result = dirBrowse.ShowDialog();

            if (result == DialogResult.OK)
            {
                settings.DownloadPath = dirBrowse.SelectedPath;
                settings.Save();
            }
        }
Exemple #7
0
        public MainX()
        {
            InitializeComponent();
            InitDevX(Settings.DevXStyle);
            tb_vsearch.Select();

            //Authenticate
            login.RunWorkerAsync();

            //Create Directories
            Settings settings = new Settings();
            if (!Directory.Exists("Active")) Directory.CreateDirectory("Active");
            if (!Directory.Exists("Downloads")) Directory.CreateDirectory("Downloads");
            if (!Directory.Exists(settings.DownloadPath)) Directory.CreateDirectory(settings.DownloadPath);

            saveDims();
        }
Exemple #8
0
        public MainX()
        {
            InitializeComponent();
            InitDevX(Settings.DevXStyle);
            tb_vsearch.Select();
            ListViewItem item = new ListViewItem("Calculating...");
            item.SubItems.Add("");
            item.SubItems.Add("");
            Recommend.Add(item);
            eUpdateRecommended = true;

            //Authenticate
            login.RunWorkerAsync();

            //Create Directories
            Settings settings = new Settings();
            if (!Directory.Exists("Active")) Directory.CreateDirectory("Active");
            if (!Directory.Exists("Downloads")) Directory.CreateDirectory("Downloads");
            if (!Directory.Exists(settings.DownloadPath)) Directory.CreateDirectory(settings.DownloadPath);

            saveDims();
        }