谁能帮我解释一下下面语句的语法:
if(!HttpContext.Current.IsDebuggingEnabled &&
HttpContext.Current.Application["TreeConfig" + treeId] != null)
//Application["TreeConfig" + treeId]是什么意思?
{
return (TreeConfigData)HttpContext.Current.Application["TreeConfig" + this.treeId];
}
treeId已经定义的变量
TreeConfigData是一个数据集
if(!HttpContext.Current.IsDebuggingEnabled &&
HttpContext.Current.Application["TreeConfig" + treeId] != null)
//Application["TreeConfig" + treeId]是什么意思?
{
return (TreeConfigData)HttpContext.Current.Application["TreeConfig" + this.treeId];
}
treeId已经定义的变量
TreeConfigData是一个数据集
解决方案 »
- 如何给datagridview某列设一个默认值
- zedGraph 曲线与X轴重合部分显示
- 开发了一个全自动实时传真收发软件,现完全免费对外发布,欢迎大家批评指正!(含代码及完整使用说明)
- 使用errorprovider后把错误提示再去掉的方法
- winform程序動態指定服務器ip問題?
- 通信方面的问题
- 有谁用过DotNetBar中的ComboBoxItem控件吗
- 询问:datatable和SqlServers的临时表的使用?
- 【初级问题,从VB6到C#,50分】流程控制
- combobox控件,怎么样设成只读的,就是只能选下拉列表框,不能运行时,手写
- 如果想做游戏,需要学什么语言呀
- 引用app.config配置文件出錯
private TreeConfigData LoadConfig()
{
if(!HttpContext.Current.IsDebuggingEnabled &&
HttpContext.Current.Application["TreeConfig" + treeId] != null)
{
return (TreeConfigData)HttpContext.Current.Application["TreeConfig" + this.treeId];
}
else
{
TreeConfigData configData = new TreeConfigData();
using(SqlConnection conn = new SqlConnection(this.ConnString))
{
SqlCommand cmd = new SqlCommand(@"select * from Sys_Tree where TreeId = @TreeId",conn);
cmd.Parameters.Add("@TreeId",treeId);
SqlDataAdapter sda = new SqlDataAdapter(cmd);
sda.TableMappings.Add(new DataTableMapping("Table", "Sys_Tree"));
sda.Fill(configData);
}
HttpContext.Current.Application["TreeConfig" + treeId] = configData;
return configData;
}
}
if(Application["属性名"]==XXX)
{
//code
}