获取Chrome浏览器下载文件夹 [英] Get chrome downloads folder

查看:1251
本文介绍了获取Chrome浏览器下载文件夹的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Windows 7的默认下载文件夹的 C:\users\username\downloads 的Chrome浏览器。但是默认的下载文件夹,可以设置为通过设置另一个文件夹。我需要找出哪些文件夹是下载文件夹。所以,如果我设置下载文件夹到的 C:\dd 的,那么我需要找出特定的文件夹。

The default downloads folder in Windows 7 is c:\users\username\downloads for Chrome. But default downloads folder can be set to another folder through settings. I need to find out which folder is the downloads folder. So if I set the downloads folder to c:\dd, then I need to find out the specific folder.

有没有发现这一点,使用的的办法C#的?我的意思是我不想访问Chrome浏览器设置,并从那里获取的文件夹路径。

Is there a way of finding this out using C#? I mean I don't want to visit the chrome settings and fetch the folder path from there.

推荐答案

适用于Chrome的默认位置设置 href=\"http://stackoverflow.com/questions/4008194/how-can-i-programmatically-access-the-google-chrome-home-or-start-page\">。我居然发现我的是根据 C:\Users [用户名] \AppData\Local\Google\Chrome\User Data\Default Chrome浏览器的 20.0。 。1132.47

The default locations for Chrome settings are here. I actually found mine to be under 'C:\Users[UserName]\AppData\Local\Google\Chrome\User Data\Default' for Chrome 20.0.1132.47.

如果您打开偏好设置文件,可以解析JSON来获得下载文件夹:

If you open the Preferences file, you can parse the JSON to get the download folder:

"download": {
  "default_directory": "C:\\Users\\[UserName]\\Downloads",
  "directory_upgrade": true,
  "extensions_to_open": ""
}

如果没有 default_directory 值,然后将目录 C:\Users\ [用户​​名] \Downloads 正在使用。

If there is no default_directory value, then the directory C:\Users\[UserName]\Downloads is being used.

这篇关于获取Chrome浏览器下载文件夹的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆