Google


   


You are here: CodeIdol.com > C# > C# Cookbook, 2nd Edition > Web

SAVE
Digg
Shown on del.icio.us del.icio.us
See Whos Talking About This on Technorati Technorati
I've Reddit reddit

C# Cookbook, 2nd Edition



Problem: You have an IP address that you need to resolve into a hostname. Solution: Use the Dns.GetHostEntry method to get the hostname for an IP address. In the following code, an IP address is resolved, and the hostname is accessible from th...



Problem: You have a string representation of a host (such as www.oreilly.com), and you need to obtain the IP address from this hostname. Solution: Use the Dns.GetHostEntry method to get the IP addresses. In the following code, a hostname is pr...



Problem: You need to split a uniform resource identifier (URI) into its constituent parts. Solution: Construct a System.Net.Uri object and pass the URI to the constructor. This class constructor parses out the constituent parts of the URI and ...

read more: Parsing a URI


Problem: You have a base URI of the form http://www.oreilly.com and a relative URI of the form hello%20world.htm; you want to form an absolute URI from them and ensure it is correctly formed. Solution: Use the Uri class to combine a base URI a...



Problem: You have obtained a response from a web server and you want to make sure that there were no errors in processing the initial request, such as failing to connect, being redirected, timing out, or failing to validate a certificate. You don't ...



Problem: You want to send a request to a web server in the form of a GET or POST request. After you send the request to a web server, you want to get the results of that request (the response) from the web server. Solution: Use the HttpWebRequ...



Problem: Many companies have a web proxy that allows employees to access the Internet, while at the same time preventing outsiders from accessing the company's internal network. The problem is that to create an application that accesses the Internet...



Problem: You need to get the HTML returned from a web server in order to examine it for items of interest. For example, you could examine the returned HTML for links to other pages or for headlines from a news site. Solution: You can use the m...



Problem: You need to display HTML-based content in a WinForms-based application. Solution: Use the System.Windows.Forms.WebBrowser class to embed web browser functionality into your application. The Cheapo-Browser seen in Figure 14-1 shows som...



Problem: You want to cache datasets you create from a database to help the performance of your ASP.NET application, but you want changes to the data in the database to be reflected in your pages. Solution: Use the SqlCacheDependency class to e...



Problem: A dataset you are using in an ASP.NET page is comprised of data from multiple data sources. You want to use caching for performance, but only one dependency object can be added with the cache item. Solution: Use the AggregateCacheDepe...



Problem: You want to prebuild your web site to avoid compilation delays and to avoid the hosting scenario in which source code needs to be on the server. Solution: Use the ClientBuildManager to prebuild your web site into an assembly. In order...



Problem: You need to transform data for use in web operations from escaped to unescaped format or vice versa for proper transmission. This escaping and unescaping should follow the format outlined in RFC 2396Uniform Resource Identifiers (URI): Gener...



Problem: You want to avoid making URI syntax errors when creating a URI. Solution: Use the UriBuilder class to add each piece without worrying about syntax or placement in the string. Building a URI programmatically can be challenging to do c...



Problem: You want to be able to modify some settings in your web application configuration file from within a web page. Solution: Use the System.Configuration.WebConfigurationManager and System.Configuration.Configuration classes to access ele...



Problem: You need to parse some HTML to get certain values from it, but you don't want to write all of the HTML parsing logic yourself. Solution: Use the Microsoft.MSHTML Primary Interop Assembly wrapper and let the Internet Explorer parsing e...



Problem: You are looking for a way to speed up code that reaches out to the Web via HTTP for content. Solution: Use the RequestCachePolicy class to determine how your HttpWebRequests react in the presence of a caching entity. RequestCachePolic...



Problem: You have an application that needs to know what custom error pages are set up for the various HTTP error return codes on a given IIS server. Solution: Use the System.DirectoryServices.DirectoryEntry class to talk to the Internet Infor...



Problem: You want to determine what application mappings are set up on a given web server for ASP.NET. Solution: Use the System.DirectoryServices.DirectoryEntry class to examine the IIS metabase for the application mappings (also known as exte...


SAVE
Digg
Shown on del.icio.us del.icio.us
See Whos Talking About This on Technorati Technorati
I've Reddit reddit

You are here: CodeIdol.com > C# > C# Cookbook, 2nd Edition > Web


ADBRITE ads links
   
Related tags







Popular Categories
Unix books and guides

AJAX popular information
C# language guides
Windows books and cookbooks

.......








Business Key Top Sites

be number one
rate your site




    С 2009 года мы стали переводить структура сайта на различные языки. Сайт теперь будет содержать книги не только на английском языке, но также и на других европейских языках, в том числе и на Русском языке.

    Русский Polski Francais Deutsch
    support sitemap terms

© CodeIdol Labs, 2007 - 2009