【发布时间】:2011-10-31 13:53:05
【问题描述】:
我正在构建 ASP.Net MVC 应用程序并希望集成 adwords API 的功能。
我在我的项目中为此创建了一个类库,在某些类中具有这些功能。
在我的类库中,我像这样实例化 AdWordsUser:
var user = new AdWordsUser();
但是当我在我的网络项目中使用我的库时,它不会读取 web.config 文件中的 adwords 配置。
所以我尝试像这样以编程方式传递配置:
var config = new Dictionary<string, string>();
config.Add("EnableGzipCompression", "true");
config.Add("UserAgent", "xxxx");
config.Add("DeveloperToken", "xxxxx");
config.Add("ClientCustomerId", "xxxxx");
config.Add("AuthorizationMethod", "ClientLogin");
config.Add("Email", "xxxxx@xxxxxxx.xxx");
config.Add("Password", "xxxxx");
this.CurrentAdwordsUser = new AdWordsUser(config);
但它告诉我它不能将字符串转换为布尔值。
有人知道怎么做吗?
【问题讨论】:
-
在哪里出现错误?
-
当我执行查询时。但这似乎是因为它等待配置强类型,但 AdWordsUser 的构造函数只采用 Dictionary
...
标签: c# asp.net google-ads-api