简体   繁体   中英

export IDM download list using C#

I have to make a program to back up my IDM download list every day, because there is other ones using my computer and they removing my download list.

IDM API only lets me add download to IDM list, so is there any library or other way to back up my IDM download list using C#?

thanks for helping

Thanks to @Setsu found out a solution. there is a key in registry which contains all of the URLs. the key is HKEY_CURRENT_USER\\Software\\DownloadManager and it contains keys which contains values named Url0 with the URL in it.

As an example HKEY_CURRENT_USER\\Software\\DownloadManager\\85\\Url0 contains one of added link to IDM download list.

So I searched all of the HKEY_CURRENT_USER\\Software\\DownloadManager subkeys for Url0 and saved the values to a list box using this code:

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Microsoft.Win32;

namespace IDMListSaver
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            RegistryKey key = Registry.CurrentUser.OpenSubKey("Software\\DownloadManager");
            string[] keys = key.GetSubKeyNames();
            for (int i = 0; i <= key.SubKeyCount-1; i++)
            {
                key = key.OpenSubKey(keys[i]);
                Object o = key.GetValue("Url0");
                if (o != null)
                {
                    listBox1.Items.Add(o);
                }
                key = Registry.CurrentUser.OpenSubKey("Software\\DownloadManager");
            }
        }
    }
}

It definitely can get better, but it solved my problem until here.

So thanks again @Setsu

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM