473,388 Members | 1,326 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,388 software developers and data experts.

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().AssemblyQualifiedName gets me much more than i want.

is there a better way?

thanks in advance.
Apr 25 '06 #1
2 3566
Can you clarify what Type.AssemblyQualifiedName 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.GetName().Name)

--
Kevin Westhead

"Craig Buchanan" <na**@company.com> wrote in message
news:eu**************@TK2MSFTNGP03.phx.gbl...
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().AssemblyQualifiedName gets me much more than i want.

is there a better way?

Apr 25 '06 #2
I get: Lucky.Folder, FolderPlugin, Version=1.0.2306.14634,
Culture=neutral, PublicKeyToken=null

I want: Lucky.Folder, FolderPlugin

Thanks.

"Kevin Westhead" <ma***********@nospam.nospam> wrote in message
news:%2****************@TK2MSFTNGP04.phx.gbl...
Can you clarify what Type.AssemblyQualifiedName 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.GetName().Name)

--
Kevin Westhead

"Craig Buchanan" <na**@company.com> wrote in message
news:eu**************@TK2MSFTNGP03.phx.gbl...
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().AssemblyQualifiedName gets me much more than i want.

is there a better way?


Apr 25 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: JohnnySparkles | last post by:
Hi everyone, I'm currently writing an application which uses the XmlSerializer class to serialize/deserialize objects to/from xml. Now when deserializing an XmlDocument back into the object,...
6
by: h | last post by:
Hi! I have a user control called ListItemControl. This works ok: ListItemControl li = new ListItemControl(); When I iterate with Enumerator through all controls using: IEnumerator e =...
6
by: Jim Bancroft | last post by:
Hi everyone, I'm having some trouble with the code below. I receive a compile-time error on the second line saying "; expected": private static void myTestFunction(long myLong) { ...
10
by: Bob | last post by:
This has been bugging me for a while now. GetType isn't availble for variables decalred as interface types, I have to DirectCast(somevariable, Object). In example: Sub SomeSub(ByVal...
1
by: Jennyfer Barco | last post by:
Hello I have a question. I have a project called "Primary" and in that project I have a reference to a Com application called "engine". In "engine" I have a function that does many things and calls...
6
by: Paul | last post by:
I have two projects in one solution. One is called Frontier and holds all my base user controls, classes, etc. that are used over multiple applications. The second is my application project...
7
by: Sky | last post by:
I have been looking for a more powerful version of GetType(string) that will find the Type no matter what, and will work even if only supplied "{TypeName}", not the full "{TypeName},{AssemblyName}"...
3
by: Ron M. Newman | last post by:
Hi, I have a certain assembly that needs to create instances of objects where the object class is passed as a string (e.g. "System.Drawing.Bitmap"). I have found that calling "GetType" on this...
4
by: Steph | last post by:
hello, i want to find the type from a generic... like : public static john<T>(object obj, T myControl) { ((myControl.getType())myControl).OnClientClick ="code"; } because my generic var can...
5
by: TonyJ | last post by:
Hello!! This first expression return System.Int32. The type that is returned is a string. This is perfect understandable. Console.WriteLine(7.GetType().FullName); In this second expression is...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.