Equivalent to C# typeof()?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Steve Brecher

    Equivalent to C# typeof()?

    AppSettingsRead er.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?

    --
    For mail, please use my surname where indicated:
    steve@surname.r eno.nv.us (Steve Brecher)


  • Raymond Lewallen

    #2
    Re: Equivalent to C# typeof()?

    Steve,

    myConfigReader. GetValue("param ", Type.GetType("S tring"))

    HTH,

    Raymond Lewallen


    Comment

    • CJ Taylor

      #3
      Re: Equivalent to C# typeof()?

      gettype

      "Steve Brecher" <Steve_Brecher@ see.sig.at.end> wrote in message
      news:OKRzq8MHEH A.3500@TK2MSFTN GP10.phx.gbl...[color=blue]
      > AppSettingsRead er.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?
      >
      > --
      > For mail, please use my surname where indicated:
      > steve@surname.r eno.nv.us (Steve Brecher)
      >
      >[/color]


      Comment

      • Raymond Lewallen

        #4
        Re: Equivalent to C# typeof()?

        Steve,

        myConfigReader. GetValue("param ", Type.GetType("S tring"))

        HTH,

        Raymond Lewallen


        Comment

        • CJ Taylor

          #5
          Re: Equivalent to C# typeof()?

          gettype

          "Steve Brecher" <Steve_Brecher@ see.sig.at.end> wrote in message
          news:OKRzq8MHEH A.3500@TK2MSFTN GP10.phx.gbl...[color=blue]
          > AppSettingsRead er.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?
          >
          > --
          > For mail, please use my surname where indicated:
          > steve@surname.r eno.nv.us (Steve Brecher)
          >
          >[/color]


          Comment

          • Steve Brecher

            #6
            Re: Equivalent to C# typeof()?

            Raymond Lewallen <Raymond.CTR.Le wallen@nospam.f aa.gov> wrote:[color=blue]
            > myConfigReader. GetValue("param ", Type.GetType("S tring"))[/color]

            That was a good hint; I'll use:

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

            --
            For mail, please use my surname where indicated:
            steve@surname.r eno.nv.us (Steve Brecher)


            Comment

            • Steve Brecher

              #7
              Re: Equivalent to C# typeof()?

              Raymond Lewallen <Raymond.CTR.Le wallen@nospam.f aa.gov> wrote:[color=blue]
              > myConfigReader. GetValue("param ", Type.GetType("S tring"))[/color]

              That was a good hint; I'll use:

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

              --
              For mail, please use my surname where indicated:
              steve@surname.r eno.nv.us (Steve Brecher)


              Comment

              Working...