Moh*_*mad 9 .net c# .net-3.5 c#-3.0
我有以下代码给出错误
不允许使用默认参数说明符
怎么解决这个问题?
bool listSubscribe(string apikey,
string id,
string email_address,
string [] merge_vars,
string email_type="html",
bool double_optin=false,
bool replace_interests=true,
bool send_welcome=false);
bool listUnsubscribe(string apikey,
string id,
string email_address,
bool delete_menber=false,
bool send_goodbye=true,
bool send_notify=true);
Run Code Online (Sandbox Code Playgroud)
Lar*_*ech 18
根据您的错误消息,您无法在v3.5中执行此操作.
解决方法是多个构造函数:
bool listUnsubscribe(string apikey,
string id,
string email_address) {
return listUnsubscribe(apikey, id, email_address, false, true, true);
}
bool listUnsubscribe(string apikey,
string id,
string email_address,
bool delete_menber,
bool send_goodbye,
bool send_notify) {
return whatever;
}
Run Code Online (Sandbox Code Playgroud)
小智 9
我刚刚遇到这个错误,我的项目也是针对4.0而不是3.5或更低.
我将其切换为3.5,然后再切换回4.0,然后错误消失了.希望这些步骤对您或其他人有用.
| 归档时间: |
|
| 查看次数: |
35101 次 |
| 最近记录: |