Friday, September 10th, 2010
C# Network Programming

Send a webrequest and display webresponse along with headers in C#

void btnSubmit_OnClick(Object source, EventArgs e) { // Create a WebRequest WebRequest wrRequest; wrRequest = WebRequestFactory.Create(txtURL.Text);// Get the Response from the Request ...

More C# Network Programming

DnsPermissionAttribute example in C#

using System; using System.Net; using System.Security; using System.Security.Permissions; [DnsPermission(SecurityAction.Demand, Unrestricted = true)] public class DnsTest { public static String GetLocalHostName() { ...

Get domain information from the Domain Name System in C#

We can use the Dns class creates and sends queries to obtain information about a host server from the Internet Domain ...

Caching credentials using System.Net CredentialCache in C#

The System.Net CredentialCache class provides storage for multiple credentials. Applications that need to access multiple resources can store the credentials for ...

Authorization class example in C#

The Authorization class contains authentication information returned by an IAuthenticationModule module. Authorization instances are used to pass server challenge responses and ...

AuthenticationManager class example in C#

The AuthenticationManager class (System.Net) manages the authentication modules called during the client authentication process.using System; using System.Net; using System.Collections; public class AuthenticationManagerSample { ...

How to specify the type of socket in C#

The System.Net.Sockets SocketType Enumeration can be used to specify the type of socket in C#. It specifies the type of socket ...

Terminate the ability to send or receive data using the Socket.Shutdown method in C#

using System; using System.Net; using System.Net.Sockets; using System.Text; public class SocketShutdownSample { public static void Main() { ...

How to secure socket connections in C#

We can use the System.Net SocketPermission to secure socket connections in C#. SocketPermission instances control permission to accept connections or initiate ...

Socket options in C#

Socket options determine the behavior of an instance of the Socket class. Some socket options apply only to specific protocols while ...

System.Net.Sockets SocketOptionLevel example

using System; using System.Net; using System.Net.Sockets; using System.Text; public class SocketOptionLevelSample { public static void Main() { ...

How to control the transfer behavior when sending and receiving data on a Socket instance in C#

We can use the System.Net.Sockets SocketFlags Enumeration to control the transfer behavior when sending and receiving data on a Socket instance ...

Catch socket errors in C#

The System.Net.Sockets SocketException represents the error that occurs when a socket error occurs. A SocketException is thrown by the Socket and ...

Get socket address in C#

The System.Net SocketAddress provides a socket address stored in a System.Byte array. A socket address consists of a member of the ...

Socket communication mechanism on the client side in C#

1. Create the client socket. 2. Connect to the server socket using the Connect method. This sets both the ...

Socket communication mechanism on the server side in C#

1. Create a socket to listen for incoming connection requests.2. Set the local endpoint using the Bind method. 3. ...

How to specify the mode used by the Poll method of the Socket class in C#

We can use the System.Net.Sockets SelectMode Enum to specify the mode used by the Poll method of the Socket class in ...

How to specify the protocol to be used by the Socket class in C#

The System.Net.Sockets ProtocolType Enum class can be used to specify the protocol to be used by the Socket class in C#. ...

NetworkStream in C# Socket

The NetworkStream class implements the standard stream mechanism to read and write network data through an instance of the Socket class. ...

MulticastOption in C# socket

The MulticastOption contains Internet Protocol (IP) addresses used when joining or leaving an IP multicast group. The hosts listening to a ...

eXTReMe Tracker