Option Strict On Option Explicit On Public Class UserControlEnvironmentVariables Public Sub New() ' This call is required by the Windows Form Designer. InitializeComponent() ' Add any initialization after the InitializeComponent() call. GetEnvironmentVariables() End Sub Private Sub GetEnvironmentVariables() Dim variables As IDictionary = Environment.GetEnvironmentVariables() For Each variable As DictionaryEntry In variables Dim lvi As New ListViewItem lvi.Text = variable.Key.ToString lvi.SubItems.Add(variable.Value.ToString) lstEnvVariables.Items.Add(lvi) Next End Sub Public Sub CollectReportData() Dim newReport As TextReport = FormMain.TextReportFile Dim variables As IDictionary = Environment.GetEnvironmentVariables() newReport.WriteItem("Variable", "Value") For Each variable As DictionaryEntry In variables newReport.WriteItem(variable.Key.ToString, variable.Value.ToString) Next End Sub 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.
This article, along with any associated source code and files, is licensed under The Common Development and Distribution License (CDDL)