GetType question

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Craig Buchanan

    #1

    GetType question

    I would like to have a string representation of my classes type and assembly
    in format of full name, assembly.

    Me.GetType() gets me the fullname

    Me.GetType().As semblyQualified Name gets me much more than i want.

    is there a better way?

    thanks in advance.


  • Kevin Westhead

    #2
    Re: GetType question

    Can you clarify what Type.AssemblyQu alifiedName is giving you that you don't
    want, perhaps with an example of your desired output?

    If you're only interested in the simple name of the assembly then you could
    try the following (not compiled):

    Dim t As Type = Me.GetType()
    Dim s As String = String.Format(" {0}, {1}", t.FullName,
    t.Assembly.GetN ame().Name)

    --
    Kevin Westhead

    "Craig Buchanan" <name@company.c om> wrote in message
    news:euNB8DIaGH A.1560@TK2MSFTN GP03.phx.gbl...[color=blue]
    >I would like to have a string representation of my classes type and
    >assembly in format of full name, assembly.
    >
    > Me.GetType() gets me the fullname
    >
    > Me.GetType().As semblyQualified Name gets me much more than i want.
    >
    > is there a better way?[/color]


    Comment

    • Craig Buchanan

      #3
      Re: GetType question

      I get: Lucky.Folder, FolderPlugin, Version=1.0.230 6.14634,
      Culture=neutral , PublicKeyToken= null

      I want: Lucky.Folder, FolderPlugin

      Thanks.

      "Kevin Westhead" <mapson.mapson@ nospam.nospam> wrote in message
      news:%23iZdnBJa GHA.4916@TK2MSF TNGP04.phx.gbl. ..[color=blue]
      > Can you clarify what Type.AssemblyQu alifiedName is giving you that you
      > don't want, perhaps with an example of your desired output?
      >
      > If you're only interested in the simple name of the assembly then you
      > could try the following (not compiled):
      >
      > Dim t As Type = Me.GetType()
      > Dim s As String = String.Format(" {0}, {1}", t.FullName,
      > t.Assembly.GetN ame().Name)
      >
      > --
      > Kevin Westhead
      >
      > "Craig Buchanan" <name@company.c om> wrote in message
      > news:euNB8DIaGH A.1560@TK2MSFTN GP03.phx.gbl...[color=green]
      >>I would like to have a string representation of my classes type and
      >>assembly in format of full name, assembly.
      >>
      >> Me.GetType() gets me the fullname
      >>
      >> Me.GetType().As semblyQualified Name gets me much more than i want.
      >>
      >> is there a better way?[/color]
      >
      >[/color]


      Comment

      Working...