蒙在股里 发表于 2015-1-16 22:46:42

ASP.NET网站制作之web.config设置文件示例

竟发现没有太大的帮助。总觉得要用起来,感觉到不了位。因为公司机器的原因,一直没有安装vs.net(也从来没有用过)。以前做asp的时候一直用DW(感觉其代码联想功能不错),可现在到了asp.net却不习惯了。web|示例为了便利设置web.config文件,我写了一个经常使用的web.config文件的示例,能够以此为模版依据必要修正。
创立web.config文件的三种快速办法:
1、用VS2005中的asp.net网站设置工具设置
2、参考C:WINDOWSMicrosoft.NETFrameworkv2.0.50727(.netframework版本)CONFIG目次下的machine.config文件举行编写
3、以下边这个文件作模版修正

点击此处睁开代码
<?xmlversion="1.0"encoding="utf-8"?>
<!--
注重:除手动编纂此文件之外,您还可使用
Web办理工具来设置使用程序的设置。可使用VisualStudio中的
“网站”->“Asp.Net设置”选项。
设置和正文的完全列表在
machine.config.comments中,该文件一般位于
WindowsMicrosoft.NetFrameworkv2.xConfig中
-->
<configurationxmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">
<appSettings>
<!--Enabledatacaching-->
<addkey="EnableCaching"value="true"/>
</appSettings>
<connectionStrings>
<addname="strConnUserDB"
connectionString="DataSource=.;InitialCatalog=profile1;IntegratedSecurity=True"
providerName="System.Data.SqlClient"/>
</connectionStrings>
<system.web>
<membership>
<providers>
<removename="AspNetSqlMembershipProvider"/>
<addname="AspNetSqlMembershipProvider"
type="System.Web.Security.SqlMembershipProvider,System.Web,Version=2.0.0.0,Culture=neutral,PublicKeyToken=b03f5f7f11d50a3a"
connectionStringName="strConnUserDB"
enablePasswordRetrieval="false"
enablePasswordReset="true"
requiresQuestionAndAnswer="true"
applicationName="/"
requiresUniqueEmail="false"
passwordFormat="Hashed"
maxInvalidPasswordAttempts="5"
minRequiredPasswordLength="7"
minRequiredNonalphanumericCharacters="1"
passwordAttemptWindow="10"
passwordStrengthRegularExpression=""
description="存储membership数据"
/>
</providers>
</membership>
<profileenabled="true"defaultProvider="AspNetSqlProfileProvider"inherits="">
<providers>
<removename="AspNetSqlProfileProvider"/>
<addname="AspNetSqlProfileProvider"
connectionStringName="strConnUserDB"
applicationName="/"
type="System.Web.Profile.SqlProfileProvider,System.Web,Version=2.0.0.0,Culture=neutral,PublicKeyToken=b03f5f7f11d50a3a"
description="存储Profile数据"
/>
</providers>
<properties>
<addname="Name"/>
<addname="BackColor"type="System.Drawing.Color"allowAnonymous="true"serializeAs="Binary"/>
</properties>
</profile>

<roleManagerenabled="true"cacheRolesInCookie="true">
<providers>
<removename="AspNetSqlRoleProvider"/>
<addname="AspNetSqlRoleProvider"
connectionStringName="strConnUserDB"
applicationName="/"
type="System.Web.Security.SqlRoleProvider,System.Web,Version=2.0.0.0,Culture=neutral,PublicKeyToken=b03f5f7f11d50a3a"
description="存储Role数据"
/>
</providers>
</roleManager>
<!--OtherroleManagerattributes(andtheirdefaults)include:
cookieName=".ASPXROLES"
cookieTimeout="30"
cookiePath="/"
cookieRequireSSL="false"
cookieSlidingExpiration="true"//Renewexpiringcookies?
createPersistentCookie="false"//Issuepersistentcookie?
cookieProtection="All"/>//Cookieprotectionlevel
-->
<compilationdebug="false"/>
<authenticationmode="Forms"/>
<!--
<anonymousIdentification
enabled="true"
cookieName=".ASPXANONYMOUS"
cookieTimeout="43200"
cookiePath="/"
cookieRequireSSL="false"
cookieSlidingExpiration="true"
cookieProtection="All"
cookieless="UseCookies"
/>
-->
<!--
<customErrorsmode="RemoteOnly"defaultRedirect="GenericErrorPage.htm">
<errorstatusCode="403"redirect="NoAccess.htm"/>
<errorstatusCode="404"redirect="FileNotFound.htm"/>
</customErrors>
-->
</system.web>
<locationpath="user">
<system.web>
<authorization>
<allowroles="?"/>
<denyusers="*"/>
</authorization>
</system.web>
</location>
</configuration>
语言是不是不是最重要的?

透明 发表于 2015-1-19 23:25:53

ASP.NET可以无缝地与WYSIWYGHTML编辑器和其他编程工具(包括MicrosoftVisualStudio.NET)一起工作。这不仅使得Web开发更加方便,而且还能提供这些工具必须提供的所有优点,包括开发人员可以用来将服务器控件拖放到Web页的GUI和完全集成的调试支持。微软为ASP.net设计了这样一些策略:易于写出结构清晰的代码、代码易于重用和共享、可用编译类语言编写等等,目的是让程序员更容易开发出Web应用,满足计算向Web转移的战略需要。

爱飞 发表于 2015-1-19 23:25:53

比如封装性、继承性、多态性等等,这就解决了刚才谈到的ASP的那些弱点。封装性使得代码逻辑清晰,易于管理,并且应用到ASP.Net上就可以使业务逻辑和Html页面分离,这样无论页面原型如何改变。

第二个灵魂 发表于 2015-1-28 06:30:33

主流网站开发语言之JSP:JSP和Servlet要放在一起讲,是因为它们都是Sun公司的J2EE(Java2platformEnterpriseEdition)应用体系中的一部分。

因胸联盟 发表于 2015-2-5 14:07:40

碰到复杂点的问题都不知道能不能解决,现在有点实力的公司都选择自已在开源的基础上做开发。但没听说过有人在IIS上做改进的,windows、sqlserver集群方面的应用也很少见。

金色的骷髅 发表于 2015-2-12 03:19:10

逐步缩小出错代码段的范围,最终确定错误代码的位置。

山那边是海 发表于 2015-3-2 21:31:18

但是目前在CGI中使用的最为广泛的是Perl语言。所以,狭义上所指的CGI程序一般都是指Perl程序,一般CGI程序的后缀都是.pl或者.cgi。

精灵巫婆 发表于 2015-3-11 06:32:34

CGI程序在运行的时候,首先是客户向服务器上的CGI程序发送一个请求,服务器接收到客户的请求后,就会打开一个新的Process(进程)来执行CGI程序,处理客户的请求。CGI程序最后将执行的结果(HTML页面代码)传回给客户。

分手快乐 发表于 2015-3-17 22:28:35

现在主流的网站开发语言无外乎asp、php、asp.net、jsp等。

再现理想 发表于 2015-3-25 04:19:40

能产生和执行动态、交互式、高效率的站占服务器的应用程序。运用ASP可将VBscript、javascript等脚本语言嵌入到HTML中,便可快速完成网站的应用程序,无需编译,可在服务器端直接执行。容易编写。
页: [1]
查看完整版本: ASP.NET网站制作之web.config设置文件示例