google chrome 浏览器 - read/write C# 中的设置

google chrome browser - read/write settings in C#

我需要构建一个控制台程序来读取和更新 chrome 浏览器设置。

我应该从哪里开始?

Chrome 设置存储在注册表中,因此 here to read/write the registry and here 用于可用设置列表。

RegistryKey key = Registry.CurrentUser.CreateSubKey(@"SOFTWARE\OurSettings"); 

/// Reading value 
var value = key.GetValue("Setting1");

/// Setting value
key.SetValue("Setting1", "This is our setting 1"); 

如果您开发的不是供内部使用,请注意 Google 的警告:

These policies are strictly intended to be used to configure instances of Google Chrome internal to your organization. Use of these policies outside of your organization (for example, in a publicly distributed program) is considered malware and will likely be labeled as malware by Google and anti-virus vendors.

检查是否可以修改以下文件。

位置 - c:\Users\\AppData\Local\Google\Chrome\User Data\Default\Preferences

此文件包含一些设置。我从来没有这样做过,所以不确定你是否可以修改文件。但看起来是一个好的开始。另外,不确定 chrome 是否重建文件。 (当我在我的机器上打开这个文件时打开 chrome 时它被更新了)。