tailieunhanh - Professional ASP.NET 3.5 in C# and Visual Basic Part 123
Professional in C# and Visual Basic Part 123. Building on the revolutionary release, adds several key new developer features including AJAX, LINQ, and a new CSS designer in Visual Web Developer 2008. The dramatic reduction in code that developers realized from the more than 50 new server controls in now allows developers the time to make their applications more interactive with AJAX, to work with data in their preferred language with LINQ, and to build visually attractive and consistent standards-based sites with CSS. . | Chapter 25 File I O and Streams region IHttpModule Members void throw new Exception The method or operation is not implemented. void HttpApplication context new EventHandler context_BeginRequest void context_BeginRequest object sender EventArgs e HttpApplication app HttpApplication sender Get the Accept-Encoding HTTP header from the request. The requesting browser sends this header which we will use to determine if it supports compression and if so what type of compression algorithm it supports string encodings Accept-Encoding if encodings null return Stream s encodings if gzip new GZipStream s Content-Encoding gzip GZIP Compression on else new DeflateStream s Content-Encoding deflate Deflate Compression on endregion After you create and build the module add the assembly to your Web site s Bin directory. After that s done you let your Web application know that it should use the HttpModule when it runs. Do this by adding the module to the file. Listing 25-23 shows the nodes to add to the configuration section. 1180 Chapter 25 File I O and Streams Listing 25-23 Adding an HttpCompression module to the httpModules add name HttpCompressionModule type HttpCompressionModule httpModules trace enabled true Notice that one other change you are making is to enable page tracing. You use this to demonstrate that the page is actually being compressed. When you run the page you should see the trace output shown in Figure 25-14. Notice a new entry under the trace information showing that the GZip compression has been enabled on this page. Figure 25-14 Working with Serial Ports
đang nạp các trang xem trước