如何编写和使用web.config? [英] How to write and use web.config?

查看:66
本文介绍了如何编写和使用web.config?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我是ASP.Net的新手.
我们如何编写代码并在网站中使用它?

在此先谢谢您. >在ASP.NET中使用Web.Config [ [ ^ ]


它包含您的数据库连接信息.在这里,您可以提供连接属性,例如数据库名称-服务器名称-用户名-密码"等.

停留在要使用该连接的页面上,只需添加nmaespace
System.Configuration.ConfigurationManager.AppSettings("web.config中的连接字符串的名称")

< a href ="http://www.codersource.net/asp-net/asp-net-advanced/asp-net-web-config-configuration-file.aspx"</a>

Hi all,

I am new to ASP.Net.
How we write code and use it in website?

Thanks in advance.

解决方案

First Googled result Using Web.Config in ASP.NET[^]


like this[^]


It contains your database connection information. Here you give the connection properties like DB Name-Server Name-Username-Password etc..

Rest at page where you want to use that connection just Add nmaespace
System.Configuration.ConfigurationManager.AppSettings("Name of The Connection String in web.config")

<a href="http://www.codersource.net/asp-net/asp-net-advanced/asp-net-web-config-configuration-file.aspx"></a>


这篇关于如何编写和使用web.config?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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