当前位置: 首页 > news >正文

传播公司可以做门户网站吗网站建设的价钱

传播公司可以做门户网站吗,网站建设的价钱,wordpress制作网站模板,建站平台wp近期一个项目需要写许多的配置项#xff0c;发现在单个web.config里面写的话会很乱也难于查找 所以搜了一下解决了#xff0c;记录下来 一、 webconfig提供了引入其他config的方式 connectionStrings configSourceConfigs\database.config / 这个是连接…   近期一个项目需要写许多的配置项发现在单个web.config里面写的话会很乱也难于查找 所以搜了一下解决了记录下来     一、   webconfig提供了引入其他config的方式 connectionStrings configSourceConfigs\database.config / 这个是连接字符串的配置你可以在database。config里面写很多链接字符串以备自己调用 database。config里面的内容如下 ?xml version1.0 encodingutf-8? connectionStringsadd nameSDbContext connectionStringServer.;Initial CatalogSelf;User IDsa;Passwordpassword providerNameSystem.Data.SqlClient //connectionStrings   appSettings configSourceConfigs\system.config / 这个是键值对的方式存放代码如下 ?xml version1.0 encodingutf-8? appSettings!-- 1开发系统相关配置 --!-- 登陆提供者模式Session、Cookie--add keyLoginProvider valueCookie /!-- 启用系统日志--add keyIsLog valuetrue /!-- 数据库超时间--add keyCommandTimeout value180 /!--启用IP过滤 --add keyIsIPFilter valuefalse /!-- 2系统软件参数配置 --!-- 联系我们 --add keyContact valueTE Software(Mobility) /!-- 软件名称 --add keySoftName valueSub Self /!-- 软件版本 --add keyVersion value1.0 /!-- 设置就应用路径 --add keyAppName value /!-- 设置就应用路径 --add keySqlGetBomList value / /appSettings 以上两个是不需要特殊的配置的放到configuration里面 configSections的下面这样就可以     二、下面介绍自定义配置节 configSectionssection nameusers typeSystem.Configuration.NameValueSectionHandler//configSectionsusers configSourceusers.config/users 注意configsections里面的一条是声明这是以什么组织方式 users.config 里面的内容如下 usersadd keybeijing value123/addadd keytianjin value123/add /users 获取配置的方式 NameValueCollection users System.Configuration.ConfigurationManager.GetSection(users) as NameValueCollection;// Response.Write(users.Keys[0]/brusers.Keys[1]); users.Get(beijing);     三、复杂类型 复杂类型的声明就不同了 configSectionssection nameroles typeEBuy.Chapter3.NTier.WebUI.RolesConfig, EBuy.Chapter3.NTier.WebUI//configSections roles configSourceroles.config/roles 内容如下 rolesadd usernamebeijing password123/addadd usernametianjin password123/add /roles 获取方式 using System; using System.Collections.Generic; using System.Linq; using System.Web; namespace EBuy.Chapter3.NTier.WebUI {public class RolesConfig : System.Configuration.IConfigurationSectionHandler{public object Create(object parent, object configContext, System.Xml.XmlNode section){return section;}} }XmlNode roles System.Configuration.ConfigurationManager.GetSection(roles) as XmlNode;Response.Write(roles.ChildNodes [0].Attributes[username].InnerText);   还可以配置为实体   using System; using System.Collections.Generic; using System.Linq; using System.Web; namespace EBuy.Chapter3.NTier.WebUI {public class RolesConfig : System.Configuration.IConfigurationSectionHandler{public object Create(object parent, object configContext, System.Xml.XmlNode section){var listnew ListRole();for(int i0;isection.ChildNodes.Count;i){list.Add(new Role (){Username section.ChildNodes[i].Attributes[username].InnerText ,Password section.ChildNodes[i].Attributes[password].InnerText });}return list;}}public class Role{public string Username { get; set; }public string Password{get;set;}} }var roles System.Configuration.ConfigurationManager.GetSection(roles) as ListEBuy.Chapter3.NTier.WebUI.Role ;Response.Write(roles.First ().Username);转载于:https://www.cnblogs.com/barnet/p/7132522.html
http://www.zqtcl.cn/news/644795/

相关文章:

  • 桐乡网站二次开发商城购物网站建设
  • 大连微网站制作公司网页多钱
  • 郑州网站托管助企网络营销推广合作
  • 做电商网站用什么软件企业网站建设方案范本
  • o2o商城网站搭建潍坊定制网站搭建
  • 网站建设费用说明青岛网站建设方案公司
  • 佛山市建设企业网站服务机构优化seo是什么
  • 仿70网站分类目录源码市场营销策划ppt免费模板
  • 广东圆心科技网站开发网站模板设计网页程序代码
  • 网站平台定制开发一级a做爰网站下载
  • 网站如何做流媒体wordpress导出软件
  • 电商网站流程图esp8266做网站
  • 细胞医疗 网站模版免费网址软件
  • app地推网企业seo解决方案
  • php网站转移网吧手机网站模版
  • 北京建设教育网站今天的国内新闻
  • 江苏省建设银行网站天心区网站建设公司
  • 网站分享设计网站备案收费么
  • 手机网站专题关于asp sql网站开发的书籍
  • 网站建设属于什么领域小米发布会在哪里看
  • 免费空间访客领取网站提高网站互动性
  • 湖北省市政工程建设网站汉中网站建设电话
  • 宁波大型网站推广服务丁香花在线电影小说观看
  • 合肥的网站建设公司哪家好百度旗下产品
  • 墨星写作网站阿里云购买网站登录
  • 做微网站公司知名网站设计
  • 宁波中科网站建设有限公司天津市建设 银行网站
  • 长沙建个网站一般需要多少钱化妆品网站建设方案项目书
  • 宁波外贸网站推广做网站如何选域名
  • 如何在百度上搜索到自己的网站提升关键词