Equivalent to C# typeof()?

  • Thread starter Thread starter Steve Brecher
  • Start date Start date
S

Steve Brecher

AppSettingsReader.GetValue method:

Public Function GetValue( _
ByVal key As String, _
ByVal type As Type _
) As Object

In C#, I would invoke this, e.g., with:
myConfigReader.GetValue("param", typeof(string))

What would I pass for the type parameter in VB.NET?
 
Steve,

myConfigReader.GetValue("param", Type.GetType("String"))

HTH,

Raymond Lewallen
 
Raymond Lewallen said:
myConfigReader.GetValue("param", Type.GetType("String"))

That was a good hint; I'll use:

myConfigReader.GetValue("param", GetType(String))
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top