NetworkInformationException.cs source code in C# .NET

Source code for the .NET framework in C#

                        

Code:

/ DotNET / DotNET / 8.0 / untmp / whidbey / REDBITS / ndp / fx / src / Net / System / Net / NetworkInformation / NetworkInformationException.cs / 1 / NetworkInformationException.cs

                            //------------------------------------------------------------------------------ 
// 
//     Copyright (c) Microsoft Corporation.  All rights reserved.
// 
//----------------------------------------------------------------------------- 

namespace System.Net.NetworkInformation { 
    using System; 
    using System.ComponentModel;
    using System.Net.Sockets; 
    using System.Runtime.Serialization;
    using System.Runtime.InteropServices;

    ///  
    ///    
    ///       Provides NetworkInformation exceptions to the application. 
    ///     
    /// 
    [Serializable] 
    public class NetworkInformationException : Win32Exception {
        /// 
        ///    
        ///       Creates a new instance of the  class with the default error code. 
        ///    
        ///  
        public NetworkInformationException() : base(Marshal.GetLastWin32Error()) { 
        }
 
        /// 
        ///    
        ///       Creates a new instance of the  class with the specified error code.
        ///     
        /// 
        public NetworkInformationException(int errorCode) : base(errorCode) { 
        } 

 
        internal NetworkInformationException(SocketError socketError) : base((int)socketError) {
        }

        protected NetworkInformationException(SerializationInfo serializationInfo, StreamingContext streamingContext) 
            : base(serializationInfo, streamingContext) {
        } 
 
        /// 
        ///    [To be supplied.] 
        /// 
        public override int ErrorCode {
            //
            // the base class returns the HResult with this property 
            // we need the Win32 Error Code, hence the override.
            // 
            get { 
                return NativeErrorCode;
            } 
        }

    }; // class NetworkInformationException
 

} // namespace System.Net.NetworkInformation 


                        

Link Menu

Network programming in C#, Network Programming in VB.NET, Network Programming in .NET
This book is available now!
Buy at Amazon US or
Buy at Amazon UK