开发者

System.Configuration.DefaultSettingValueAttribute

开发者 https://www.devze.com 2023-03-05 20:21 出处:网络
[global::System.Configuration.DefaultSettingValueAttribute(\"s\")] The string \"s\" must be constant. How can I pass a variable s开发者_运维知识库tring?
[global::System.Configuration.DefaultSettingValueAttribute("s")]

The string "s" must be constant. How can I pass a variable s开发者_运维知识库tring?

I mean I want it like this:

[global::System.Configuration.DefaultSettingValueAttribute(s1+"s")]

and s1 is a string.


You cannot. Like the error message says, a parameter to an attribute must be a constant value, known at compile time.

0

精彩评论

暂无评论...
验证码 换一张
取 消