advertisement

Exploring the System.Net namespace

50 %
50 %
advertisement
Information about Exploring the System.Net namespace

Published on May 30, 2008

Author: vsanchez

Source: slideshare.net

Description

Exploring the System.Net namespace
advertisement

Exploring the System.Net Namespace in the .NET Framework 2.0 Glen Gordon MSDN Developer Community Champion Microsoft http://blogs.msdn.com/glengordon

Agenda Network Status and Connectivity Protocols SMTP FTP Security HTTP Listener

Network Status and Connectivity

Protocols

SMTP

FTP

Security

HTTP Listener

Network Status and Connectivity Obtain network configuration and availability Listen for changes in network status

Obtain network configuration and availability

Listen for changes in network status

Network Information System.Net.NetworkInformation namespace Enumerate network interfaces (adapters) Connection information IP Address(es) IPv4 vs IPv6 DHCP Type (Ethernet, PPP, wireless, loopback, etc.)

System.Net.NetworkInformation namespace

Enumerate network interfaces (adapters)

Connection information

IP Address(es)

IPv4 vs IPv6

DHCP

Type (Ethernet, PPP, wireless, loopback, etc.)

Detecting Changes NetworkChange class NetworkAddressChanged event NetworkAvailabilityChanged event Shortcut in My namespace My.Computer.Network.IsAvailable property My.Computer.Network.NetworkAvailabilityChanged Event

NetworkChange class

NetworkAddressChanged event

NetworkAvailabilityChanged event

Shortcut in My namespace

My.Computer.Network.IsAvailable property

My.Computer.Network.NetworkAvailabilityChanged Event

Demonstration One Network Status

Ping System.Net.NetworkInformation namespace Synchronous or asynchronous PingReply class Shortcut in My namespace My.Computer.Network.Ping

System.Net.NetworkInformation namespace

Synchronous or asynchronous

PingReply class

Shortcut in My namespace

My.Computer.Network.Ping

Demonstration Two Using Ping

Mail System.Net.Mail namespace SmtpClient class Server, credentials, port, etc. MailMessage class Address (from, to, bcc, etc.) Contents (subject, body, alternate views) Attachments Exceptions and status

System.Net.Mail namespace

SmtpClient class

Server, credentials, port, etc.

MailMessage class

Address (from, to, bcc, etc.)

Contents (subject, body, alternate views)

Attachments

Exceptions and status

Demonstration Three Sending Mail

FTP FtpWebRequest/FtpWebResponse Derived from WebRequest/WebResponse SSL support for more secure credentials Remote commands Shortcut in My namespace My.Computer.Network.DownloadFile My.Computer.Network.UploadFile

FtpWebRequest/FtpWebResponse

Derived from WebRequest/WebResponse

SSL support for more secure credentials

Remote commands

Shortcut in My namespace

My.Computer.Network.DownloadFile

My.Computer.Network.UploadFile

Demonstration Four FTP

Security Managed wrapper for Security Support Provider Interface (SSPI) Abstract class AuthenticatedStream Server and/or client authentication Encryption and signing Can be used just like NetworkStream Synchronous or asynchronous

Managed wrapper for Security Support Provider Interface (SSPI)

Abstract class AuthenticatedStream

Server and/or client authentication

Encryption and signing

Can be used just like NetworkStream

Synchronous or asynchronous

NegotiateStream Kerberos and Windows NT ® Challenge/Response (NTLM) support Send client credentials for impersonation or delegation Credentials can be cast as Principal Request server authentication Encrypt and/or sign data Check for signing and encrypting

Kerberos and Windows NT ® Challenge/Response (NTLM) support

Send client credentials for impersonation or delegation

Credentials can be cast as Principal

Request server authentication

Encrypt and/or sign data

Check for signing and encrypting

SslStream X.509 certificates Client can check for server certificate revocation Provide client certificate for mutual authentication Exposes cryptographic settings for authentication, encryption and data signing

X.509 certificates

Client can check for server certificate revocation

Provide client certificate for mutual authentication

Exposes cryptographic settings for authentication, encryption and data signing

Demonstration Five Secure Communications

HTTP Listener Process HTTP requests without Internet Information Services (IIS) Managed API for HTTP.SYS HTTP 1.0/1.1, authentication, SSL Shares ports (Microsoft ® Windows Server™ 2003 or higher) Synchronous/asynchronous HttpListenerRequest/HttpListenerResponse

Process HTTP requests without Internet Information Services (IIS)

Managed API for HTTP.SYS

HTTP 1.0/1.1, authentication, SSL

Shares ports (Microsoft ® Windows Server™ 2003 or higher)

Synchronous/asynchronous

HttpListenerRequest/HttpListenerResponse

Demonstration Six HTTP Listener

Session Summary Your SmartClient app can be smart about network availability and configuration Mail support is versatile and standards-based (and completely managed code now!) Using request/response pattern is easy when using FTP or HTTP Communications via sockets is easier than ever to secure HTTP Listener allows you to handle web requests in scenarios where IIS isn’t appropriate

Your SmartClient app can be smart about network availability and configuration

Mail support is versatile and standards-based (and completely managed code now!)

Using request/response pattern is easy when using FTP or HTTP

Communications via sockets is easier than ever to secure

HTTP Listener allows you to handle web requests in scenarios where IIS isn’t appropriate

Additional Resources All about System.Net.Mail http://www.systemnetmail.com Series of articles on FTP http://blogs.msdn.com/adarshk/archive/category/7225.aspx Comprehensive example of HTTP Listener http://weblogs.asp.net/pglavich/archive/2005/09/04/424392.aspx

All about System.Net.Mail

http://www.systemnetmail.com

Series of articles on FTP

http://blogs.msdn.com/adarshk/archive/category/7225.aspx

Comprehensive example of HTTP Listener

http://weblogs.asp.net/pglavich/archive/2005/09/04/424392.aspx

 

Add a comment

Related pages

Exploring the .NET Framework with PowerShell – Namespaces ...

Exploring the .NET Framework with PowerShell – Namespaces (Part 5) ... scriptsPowerShell>Use-Namespace System.IO, System.Net PS C: ...
Read more

Exploring System.Net.Mail Classes

Complete FAQ for the System.Net.Mail namespace found in .NET 2.0 (Click here for System.Web.Mail) »
Read more

Exploring the .NET Framework With PowerShell – Terminology ...

Exploring the .NET Framework With PowerShell – Terminology (Part 1) ... the Webclient class is in the System.Net namespace. ... the System.Net.Webclient ...
Read more

MailMessage Class - System.Net.Mail

2 Exploring System.Net.Mail Classes; 2.1 MailMessage Class ... The MailMessage class can be considered the foundation class of the System.Net.Mail namespace.
Read more

Exploring the System Namespace - C# Primer: A Practical ...

Chapter 5. Exploring the System Namespace The System namespace provides at least three distinct levels of support for the C#/.NET programmer. At the most ...
Read more

Hosting and Consuming WCF Services - msdn.microsoft.com

This article discusses WCF hosting options and consuming WCF services. ... Exploring New Speech Recognition ... namespace QuickReturns ...
Read more

MSDN Events – Artificial Ignorance – the Anand Iyer chronicles

Tag: MSDN Events my old lady. It won ... Exploring the System.Net Namespace in the .NET Framework 2.0 Windows Communication Foundation Exposed Building the ...
Read more

adding default Assemblies, Namespaces, and Control ...

Rick Strahl's Web Log ... The fact that you can assign namespace and assemblies in your web.config file is one of the most ... Exploring .NET Core and ...
Read more

ScottGu's Blog - Sending Email with System.Net.Mail

Sending Email with System.Net.Mail. ... (Exploring Windows and/or TechNet Flash) ... then you aren't using the System.Net.Mail namespace above, ...
Read more