Click here to Skip to main content
15,884,099 members
Articles / Web Development / ASP.NET

Creating Custom Configurations

Rate me:
Please Sign up or sign in to vote.
4.47/5 (18 votes)
2 Sep 200410 min read 80.9K   1.7K   70  
Create isolated settings, strongly-typed objects and collections inside your web.config by leveraging the flexibility of .NET to create your own configuration sections and handler.
Public Class Server

#Region "Fields and Properties"
   Private _name As String
   Private _address As String
   Private _isSource As Boolean

   Public Property Name() As String
      Get
         Return _name
      End Get
      Set(ByVal Value As String)
         _name = Value
      End Set
   End Property

   Public Property IsSource() As Boolean
      Get
         Return _isSource
      End Get
      Set(ByVal Value As Boolean)
         _isSource = Value
      End Set
   End Property

   Public Property Address() As String
      Get
         Return _address
      End Get
      Set(ByVal Value As String)
         _address = Value
      End Set
   End Property
#End Region


#Region "Constructors"
   Public Sub New(ByVal name As String, ByVal address As String, ByVal isSource As Boolean)
      Me._name = name
      Me._address = address
      Me._isSource = isSource
   End Sub
   Public Sub New()
   End Sub
#End Region
End Class

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.


Written By
Canada Canada
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions