title: .net and propertyinfo of property
body: <p>i have some ressourcefile that defines some errorcodes.
  I'd like to use only strongtyping in my project.
  I also have to implement some Exception handling that prints the errors defined in the ressourcefile but also the name of the ressourceproperty.
  Think of it like this:
  Property-Name is Error1 (Type String)
  Property-Value is "This is the error"</p>
  
  <p>Now i'd like to have some funktion that prints out:
  Error1: This is the error</p>
  
  <p>Would it be possible to get the Property-Info of an info, without passing in the property-name as a string? That way i could use the name of the property and the value to output both data.</p>
  
  <p>Something like:</p>
  
  <pre><code>Public Class Form1
          Public Class PropTestClass
              Public Shared ReadOnly Property Prop1 As String
                  Get
                      Return "Test1"
                  End Get
              End Property
  
              Public Shared ReadOnly Property Prop2 As String
                  Get
                      Return "Test2"
                  End Get
              End Property
          End Class
  
  
          Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
              TestPrint(PropTestClass.Prop1)
          End Sub
  
          Public Sub TestPrint(prop As Object)
              Debug.Print(prop) '--&gt; need to output: "Prop1: Test1"
          End Sub
      End Class
  </code></pre>
  
  <p>Can use reflection, Extentions.</p>
  
  <p>Any hint?</p>