转至繁体中文版     | 网站首页 | 图文教程 | 资源下载 | 站长博客 | 图片素材 | 武汉seo | 武汉网站优化 | 
最新公告:     敏韬网|教学资源学习资料永久免费分享站!  [mintao  2008年9月2日]        
您现在的位置: 学习笔记 >> 图文教程 >> 站长学院 >> Web开发 >> 正文
ASP.NET 从Beta1 升级到 Beta2 的新变化         ★★★★

ASP.NET 从Beta1 升级到 Beta2 的新变化

作者:闵涛 文章来源:闵涛的学习笔记 点击数:3495 更新时间:2009/4/23 10:48:41
;

The following new methods implement new functionality.

         Encoding from byte[] (escaping) and decoding to byte[] (un-escaping):

string UrlEncode(byte[] bytes);

string UrlEncode(byte[] bytes, int offset, int count);

byte[] UrlEncodeToBytes(byte[] bytes);

byte[] UrlEncodeToBytes(byte[] bytes, int offset, int count);

byte[] UrlDecodeToBytes(string str);

byte[] UrlDecodeToBytes(string str, Encoding e);

byte[] UrlDecodeToBytes(byte[] bytes);

byte[] UrlDecodeToBytes(byte[] bytes, int offset, int count);

         Added for completeness:

byte[] UrlEncodeToBytes(string str, Encoding e);

string UrlDecode(byte[] bytes, Encoding e);

         The <processModel> memoryLimit attribute now applies to the percentage of physical memory instead of virtual memory. This was done to reduce customer confusion by making this match the semantics of the issue process model flag that has the same functionality and operates on physical memory. The default value has changed from 40% of virtual memory to 80% of physical memory. This should provide approximately the same metric.

         The configuration for the Impersonation config section is changing in ASP.NET to make it attribute-based.

Old Code:

<configuration>
<system.web>
<security>
<identity>
<impersonation enable="true" username="user" password="pw"/>
</identity>
</security>
</system.web>
</configuration>

New Code:

<configuration>
<system.web>
<identity impersonate="false" username="user" password="pw"/>
</system.web>
</configuration>

 

The user name and password are still optional. There are no semantic changes associated with this change.

         Cookie authentication has been renamed to Forms authentication to give it a better semantic cover for possible cookieless support in the future. The has the following impact:

The authentication mode tag value is now "Forms" instead of "Cookie"

Old name New name System.Web.Security.CookieAuthentication System.Web.Security.FormsAuthentication System.Web.Security.CookieAuthenticationEvent System.Web.Security.FormsAuthenticationEvent System.Web.Security.CookieAuthenticationEventHandler System.Web.Security.FormsAuthenticationEventHandler System.Web.Security.CookieAuthenticationModule System.Web.Security.FormsAuthenticationModule System.Web.Security.CookieAuthenticationTicket System.Web.Security.FormsAuthenticationTicket

Old Code:

<authentication mode="Cookie" />
<cookie ... />
// global.asax
CookieAuthentication_OnAuthenticate(Object, CookieAuthenticationEventArgs);

New Code:

<authentication mode="Forms" />
<cookie ... />
// global.asax
FormsAuthentication_OnAuthenticate(Object, FormsAuthenticationEventArgs);

         Passport authentication now uses the PUID for PassportIdentity.Name (User.Identity.Name). According to the Passport SDK, the unique identifier for the user should be the PUID rather than the MemberName (which has been obsoleted). This does not change the object model, but it does change authorization sections for Passport users. Instead of using a name to perform explicit authorization against Passport users, you will need to refer to the PUID (or build a group and use that for authorization purposes). Config sections that only denied anonymous users for Passport will not need to be altered. The PUID is the Passport user ID and is a concatenation of the memberidhigh and memberidlow values from the profile. The following section from the Passport SDK demonstrates how the string is constructed:

If oPassMgrObj.HasProfile Then

      dim PUID, sMemberIDHigh, sMemberIDLow

     '''' get values, convert to hexadecimal, concat and pad

      sMemberIDHigh = Hexadecimal(oMgr.Profile("memberidhigh"))

      sMemberIDLow = Hexadecimal(oMgr.Profile("memberidlow"))

      PUID = String(8 - len(sMemberIDHigh), "0") & sMemberIDHigh

      PUID = PUID & String(8 - len(sMemberIDLow), "0") & sMemberIDLow

End If

         For a combination of performance reasons and to support data validation for viewstate, the decryptionkey attribute is being removed form the <cookie> section.There will be a new config section called computerkey that looks like:


<computerkey validationkey="autogenerate" decryptionkey="autogenerate" validation="[SHA1|MD5|3DES]"/>

This allows both forms auth and viewstate to share validation keys and allows forms auth to have different keys for encryption/data validation. The default for both is "autogenerate", which uses a computer specific key. The validation attribute refers to the hashing algorithm to use; the default is SHA1, which matches current behavior. The timeout value indicates the time after which the cookie expires (this was previously hard coded or only set programmatically; it is not a breaking change) and the protection attribute defaults to "All" (matching current behavior) and allowing configurable support for weakened levels of security for increased perf for scenarios where cookie authorization is not used for strong authentication, only for personalization.

Old Code:

<cookie name="name" ... decryptionkey="autogenerate" />

New Code:

<cookie name="name" loginurl="login.aspx" protection="[All|None|Encryption|Validation]" timeout="60" />
<computerkey validationkey="autogenerate" decryptionkey="autogenerate" validation="[SHA1|MD5|3DES]"/>

         SoapException now has properties for OtherElements, Detail, and Code that are used to indicate whether a server error or a client error occurred.

         XML Serialization and Web Servises changed from 1999 XSD to 2000 XSD.

         Support has been added for special or streaming objects in web services. The Buffering property has been added on the [WebMethod] attribute and IEnumerable can now be supported as a datatype.

         The Guid and Char data types in XML serialization are now supported and will be passed through with full fidelity.

         The Web Services ClientProtocol has been updated in the following ways.

         Split ClientProtocol into WebClientProtocol and HttpWebClientProtocol. The split maps to the same split with System.Net.WebRequest and System.Net.HttpWebRequest. SoapClientprotocol is now SoapHttpClientProtocol.

         Removed Username, Password, and Domain properties. Use the Credentials property.

         Removed ProxyName and ProxyPort properties. Use the Proxy property.

         Added ConnectionGroupName property.

         Added ServicePoint property.

         The Cookies property is now a CookieContainer of type CookieContainer.

         Removed Send method.

         Changed protected methods BeginSend() and EndSend().

         Added GetWebRequest(), GetWebResponse(), InitializeAsyncRequest(), and WriteAsyncRequest() protected virtual methods. These methods are intended to be overridden (although derived classes will typically call the base class) to add features of the derived class. For example, HttpWebClientProtocol overrides GetWebRequest() to set its additional HTTP-only properties on the request object.

public abstract class WebClientProtocol : Component {

            // Constructors

protected WebClientProtocol();

// Properties

public ICredentials Credentials { get; set; }

public string ConnectionGroupName { get; set; }

public bool PreAuthenticate { get; set; }

public string Url { get; set; }

public int Timeout { get; set; }

// Methods

protected IAsyncResult BeginSend(string requestUrl, object internalAsyncState, AsyncCallback outerCallback, object outerAsyncState, bool callWriteAsyncRequest);

protected virtual WebRequest GetWebRequest(string url);

protected virtual WebResponse GetWebResponse(WebRequest request);

protected virtual WebResponse GetWebResponse(WebRequest request, IAsyncResult result);

protected virtual void InitializeAsyncRequest(WebRequest request, object internalAsyncState);

protect

上一页  [1] [2] [3] [4] [5] [6] [7]  下一页


[Delphi程序]升级到Delphi 6 - 兼容性问题(中文全文)  [Delphi程序]升级到Delphi 6 - 兼容性问题之三(完)
[Delphi程序]升级到Delphi 6 - 兼容性问题之二  [Delphi程序]升级到Delphi 6 - 兼容性问题之一
[Web开发]彻底放弃IIS让Apache也支持ASP.NET  [Web开发]ASP.NET 2.0发送电子邮件中存在的问题
[Web开发]ASP.NET 2.0移动开发之属性重写和模板化  [Web开发]ASP.NET 2.0中实现模板中的数据绑定
[Web开发]ASP.NET 母版页概述  [Web开发]ASP.NET 2.0 ObjectDataSource控件
教程录入:mintao    责任编辑:mintao 
  • 上一篇教程:

  • 下一篇教程:
  • 【字体: 】【发表评论】【加入收藏】【告诉好友】【打印此文】【关闭窗口
      注:本站部分文章源于互联网,版权归原作者所有!如有侵权,请原作者与本站联系,本站将立即删除! 本站文章除特别注明外均可转载,但需注明出处! [MinTao学以致用网]
      网友评论:(只显示最新10条。评论内容只代表网友观点,与本站立场无关!)

    同类栏目
    · Web开发  · 网页制作
    · 平面设计  · 网站运营
    · 网站推广  · 搜索优化
    · 建站心得  · 站长故事
    · 互联动态
    更多内容
    热门推荐 更多内容
  • 没有教程
  • 赞助链接
    更多内容
    闵涛博文 更多关于武汉SEO的内容
    500 - 内部服务器错误。

    500 - 内部服务器错误。

    您查找的资源存在问题,因而无法显示。

    | 设为首页 |加入收藏 | 联系站长 | 友情链接 | 版权申明 | 广告服务
    MinTao学以致用网

    Copyright @ 2007-2012 敏韬网(敏而好学,文韬武略--MinTao.Net)(学习笔记) Inc All Rights Reserved.
    闵涛 投放广告、内容合作请Q我! E_mail:admin@mintao.net(欢迎提供学习资源)

    站长:MinTao ICP备案号:鄂ICP备11006601号-18

    闵涛站盟:医药大全-武穴网A打造BCD……
    咸宁网络警察报警平台