可以定义节,该节与 <appSettings> 节使用相同的配置处理程序。例如:<configuration>
<configSections>
<sectionGroup name="myGroup">
<sectionGroup name="nestedGroup">
<section name="mySection"
type="System.Configuration.NameValueSectionHandler,
System, Version=1.0.3300.0, Culture=neutral,
PublicKeyToken=9b35aa32c18d4fb1 />
</sectionGroup>
</configSections> <myGroup>
<nestedGroup>
<mySection>
<add key="key_one" value="1" />
<add key="key_two" value="2" />
</mySection>
</nestedGroup>
</myGroup>
</configuration>可以读取上面定义的配置节的值,如下:
NameValueCollection config = (NameValueCollection)
ConfigurationSettings.GetConfig("mygroup/nestedgroup/mysection");
Response.Write("The value of key_one is " + config["key_one"] + "<br>");
Response.Write("The value of key_two is " + config["key_two"] + "<br>");
<configSections>
<sectionGroup name="myGroup">
<sectionGroup name="nestedGroup">
<section name="mySection"
type="System.Configuration.NameValueSectionHandler,
System, Version=1.0.3300.0, Culture=neutral,
PublicKeyToken=9b35aa32c18d4fb1 />
</sectionGroup>
</configSections> <myGroup>
<nestedGroup>
<mySection>
<add key="key_one" value="1" />
<add key="key_two" value="2" />
</mySection>
</nestedGroup>
</myGroup>
</configuration>可以读取上面定义的配置节的值,如下:
NameValueCollection config = (NameValueCollection)
ConfigurationSettings.GetConfig("mygroup/nestedgroup/mysection");
Response.Write("The value of key_one is " + config["key_one"] + "<br>");
Response.Write("The value of key_two is " + config["key_two"] + "<br>");
解决方案 »
- 如何在用户注册时给用户生成一个个性化域名,就象点点网那样?
- 问一个问题
- 高分求教:在程序里面(服务器端)调用Winrar压缩文件的方法?另寻求一条语句转换的方法。vb.net到C#。up有分
- 成员和类,System.Windows.Controls和System.Windows.Forms
- 新建ASP.NET一个项目后,怎么在我的文档中也有,在WWWROOT中也有?
- C#中,把SQL语句换成存储过程,不能调试通过!!! 急!!!快来帮忙!
- 有关jsp的疑问。
- Session 的问题
- 班门斧.飞刀等高手请指教!
- Xamarin Android开发
- Response.Redirect("left.aspx");
- 请问在WebForm中可以使用WinForm控件吗?如果可以怎么做?使用时客户端是否要下载这个控件?
Response.Write("<Script language='javascript'>window.resizeTo(" & intWidth & "," & intHeight & ")</Script>")
这样的话,页面尺寸将在客户端下载完页面HTML代码后开始执行并改变浏览器窗体尺寸。
但是有个缺陷,页面尺寸看起来象“变魔术”,刚开始的时候是默认大小,网速快的话瞬间改变没感觉,网速慢的话就会让人觉得不舒服。
请高手提供更好方案。
<!--
function reSize(){
h1 = 200
w1 = screen.availwidth;
if (w1>1000) {
w1=350
h1=200
}
else if (w1>790)
{
w1=200
h1=200
}
else if (w1>700)
{
w1=200
h1=200
}
else if (w1>620)
{
w1=150
h1=200
}
self.moveTo(w1,h1);
self.resizeTo(350,270);
}
function InitBoby()
{
reSize();
if (document.all.TboxName.value=="")
{
document.all.TboxName.focus();
}
else
{
document.all.TboxPwd.focus();
}
document.all.TboxPwd.Enabled=false;
}
function tet()
{
alert("test");
}
//-->
</script>
window.resizeTo("+winWidth+","+winHeight+");
</script>";
this.Page.RegisterStartupScript("resizeWin",javastr);