Mega Code Archive

 
Categories / VB.Net Tutorial / Reflection
 

Use the SetData(String, Object) method to create a new value pair

Imports System Imports System.Reflection Class ADGetData       Public Shared Sub Main()       Dim currentDomain As AppDomain = AppDomain.CurrentDomain       currentDomain.SetData("ADVALUE", "Example value")       Console.WriteLine(("ADVALUE is: " & currentDomain.GetData("ADVALUE")))       Console.WriteLine("System value for loader optimization: {0}", _          currentDomain.GetData("LOADER_OPTIMIZATION"))    End Sub  End Class