Google


   


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

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 need to create a server that listens on a port for incoming requests from a TCP client. These client requests can then be processed at the server, and any responses can be sent back to the client. Recipe 16.2 shows how to write a TCP cl...



Problem: You want to interact with a TCP-based server. Solution: Use the MyTcpClient class shown in Example 16-2 to connect to and converse with a TCP-based server by passing the address and port of the server to talk to, using the System.Net....



Problem: You need to send a collection of name-value pairs to simulate a form being executed on a browser to a location identified by a URL. Solution: Use the System.Net.WebClient class to send a set of name-value pairs to the web server using...



Problem: You need to download data from a location specified by a URL; this data can be either an array of bytes or a file. Solution: Use the WebClient.DownloadData method to download data from a URL: string uri = "http://localhost/mysite/...



Problem: You need a way to use named pipes to communicate with another application across the network. Solution: Create a P/Invoke wrapper class for the named-pipe APIs in Kernel32.dll. You can then create a managed client and managed server c...



Problem: You want to check a computer's availability on the network. Solution: Use the System.Net.NetworkInformation.Ping class to determine if a machine is available. In the TestPing method, an instance of the Ping class is created. A ping re...



Problem: You want to be able to send email via SMTP from your program, but you don't want to learn the SMTP protocol and hand-code a class to implement it. Solution: Use the System.Net.Mail namespace, which contains classes to take care of the...



Problem: You need to determine the characteristics of the network adapters currently on the machine. Solution: Use the DisplayNICInfo method shown in Example 16-9 to display all of the characteristics of the currently existing network adapters...



Problem: You want to determine the open ports on a machine to see where the security risks are. Solution: Use the CheapoPortScanner class constructed for your use; its code is shown in Example 16-11. CheapoPortScanner uses the Socket class to ...



Problem: Your program wants to use the current Internet connection settings without forcing the user to add them to your application manually. Solution: Read the current Internet connectivity settings with the InternetSettingsReader class prov...



Problem: You want to programmatically download files using the File Transfer Protocol (FTP). Solution: Use the System.Net.FtpWebRequest class to download the files. FtpWebRequests are created from the WebRequest class Create method by specifyi...


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 > Networking


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