PropertyDataCollection.Item[String] PropertyDataCollection.Item[String] PropertyDataCollection.Item[String] PropertyDataCollection.Item[String] Property


Gets the specified property from the PropertyDataCollection, using [] syntax. This property is the indexer for the PropertyDataCollection class.

 virtual property System::Management::PropertyData ^ default[System::String ^] { System::Management::PropertyData ^ get(System::String ^ propertyName); };
public virtual System.Management.PropertyData this[string propertyName] { get; }
member this.Item(string) : System.Management.PropertyData
Default Public Overridable ReadOnly Property Item(propertyName As String) As PropertyData


String String String String

The name of the property to retrieve.

Property Value

Returns a PropertyData containing the data for a specified property in the collection.


The following example gets the Freespace property from a ManagementClass.

using System;
using System.Management;
public class Sample
    public static void Main(string[] args) 
        ManagementObject m = new ManagementObject(
        Console.WriteLine("Free space on drive C is: " +
            m.Properties["Freespace"].Value + " bytes");
Imports System.Management

Class Sample_ManagementClass
    Public Overloads Shared Function Main( _
        ByVal args() As String) As Integer

        Dim m As New ManagementObject( _
        Console.WriteLine( _

        Return 0
    End Function
End Class


Property Value

A PropertyData, based on the name specified.

.NET Framework Security

Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.

Applies to