tel*_*ari 7 c# static simple-form
我有一个静态字符串变量,我需要根据HTTP协议进行更改.
更改静态字符串变量>是不好的做法
static string QuoteWebServiceUrl = CommonFunctions.ReadAppSetting("QuoteWebServiceUrl");
if(url == "https")
{
QuoteWebServiceUrl = CommonFunctions.ReadAppSetting("QuoteWebServiceUrlSecure");
}
else
{
QuoteWebServiceUrl = CommonFunctions.ReadAppSetting("QuoteWebServiceUrl");
}
Run Code Online (Sandbox Code Playgroud)
谢谢
Che*_*hen 10
不可以.当然,您可以更改静态字符串变量的值.为什么你认为这是一个糟糕的实践?
归档时间: |
|
查看次数: |
26468 次 |
最近记录: |