什么是configurationmanager.appsettin ... [英] What is configurationmanager.appsettin...

查看:85
本文介绍了什么是configurationmanager.appsettin ...的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

什么是

ConfigurationManager.AppSettings["SMSUserId"] != null ? Convert.ToString(ConfigurationManager.AppSettings["SMSUserId"]) : "2000055403";





我尝试了什么:



什么是



What I have tried:

what is

ConfigurationManager.AppSettings["SMSUserId"] != null ? Convert.ToString(ConfigurationManager.AppSettings["SMSUserId"]) : "2000055403";

推荐答案

这是一个if的简短形式:

It's a short form of an if:
if (a) 
   {
   x = b;
   }
else
   {
   x = c;
   }

浓缩为:

Is condensed to:

x = a ? b : c;

在这种情况下,如果设置存在(即它不为空),则将设置作为字符串返回。如果它不存在,则返回默认值2000055403。

In this case, if the setting exists (i.e. it's not null) it returns the setting as a string. If it doesn;t exist, it returns a default value "2000055403" instead.


请参考以下链接获取configurationmanager.appsetting





ConfigurationManager .AppSettings属性(System.Configuration)
Please refer below link for configurationmanager.appsetting


ConfigurationManager.AppSettings Property (System.Configuration)


这篇关于什么是configurationmanager.appsettin ...的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆