How to: class / type name | Bytes (2024)

Home Posts Topics Members FAQ

Eric

Is there an easy way to get a string representation? Wasn't apparent to me
from looking at the reflection class.

Thanks,
Eric

Dec 2 '06 #1

Subscribe Reply

2 How to: class / type name | Bytes (1) 1168 How to: class / type name | Bytes (2)

Jon Shemitz

Eric wrote:

Is there an easy way to get a string representation? Wasn't apparent to me
from looking at the reflection class.

Of a type's name? The Type.Name property or Type.FullName is probably
what you want.

You get a runtime Type instance from typeof(ClassNam e) or
ClassInstance.G etType().

--

..NET 2.0 for Delphi Programmers
www.midnightbeach.com/.net
What you need to know.

Dec 3 '06 #2

Dave Sexton

Hi Eric,

Type type = typeof(System.O bject); // Type known at design-time

string name = type.FullName;
// System.Object

string qualified = type.AssemblyQu alifiedName;
// System.Object, mscorlib, Version=2.0.0.0 , Culture=neutral ,
// PublicKeyToken= b77a5c561934e08 9

or

// Type unknown at design-time
Type type = objAnyInstance. GetType();

--
Dave Sexton

"Eric" <ef******@yahoo .comwrote in message
news:Wv******** *********@newsf e15.phx...

Is there an easy way to get a string representation? Wasn't apparent to me
from looking at the reflection class.

Thanks,
Eric


Dec 3 '06 #3

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

Similar topics

3 2687

Read-only class properties

by: George Sakkis |last post by:

I'm trying to write a decorator similar to property, with the difference that it applies to the defining class (and its subclasses) instead of its instances. This would provide, among others, a way to define the equivalent of class-level constants: class Foo(object): @classproperty def TheAnswer(cls): return "The Answer according to %s is...

Python

3019

XmlSerializer constructor crashes with 'xsd.exe' generated class

by: keith bannister via .NET 247 |last post by:

(Type your message here) -------------------------------- From: keith bannister Hi, I'm new to .net (as of last week) but here goes. I want to serialize/deserialize a file the conforms to an XML schema (xsd).

.NET Framework

5 7275

XmlSerializer constructor fails with xsd.exe generated class

by: Keith Bannister |last post by:

I'm new to .net so here goes. I'm tying to deserialize a class that is associated with an XML schema. I created the C# class with xsd.exe as below: xsd.exe /c /n:somenamespace properties.xsd this creates properties.cs

.NET Framework

10 3473

Variable Goes Out Of Scope When Used In Remoted Class

by: Not Available |last post by:

On the host server: namespace JCart.Common public class JCartConfiguration : IConfigurationSectionHandler private static String dbConnectionString; public static String ConnectionString { get { return dbConnectionString;

C# / C Sharp

6 2215

Profile or Custom Class How to migrate to ASP.NEt 2.0

by: Shimon Sim |last post by:

Hi I am working on application that need to hold custom user information - Last and first name, email, some other domain related information. I used to create Base class for all my pages. The base class would have CurrentUser property that would hold customer class in session and that was fine for all my situations. Now ASP.NET 2.0 came...

ASP.NET

5 1950

Define "class" please

by: Rob |last post by:

In many articles related to VB.net the word "class" is used... How many meanings are there to this word ? "possible to derived a class from another" "forms are full-fledged classes" "base class"

Visual Basic .NET

18 2882

STL: copy vector of class ?

by: sd2004 |last post by:

could someone please show/help me to copy all element from "class dog" to "class new_dog" ? Note: "class new_dog" has new element "age" which should have value "my_age" /////////////////////////////// source code /////////////////////////////// #include<iostream> #include <string> #include<vector> #include<sstream>

C / C++

1226

Proxy Class generation problem

by: bbalet.free.fr |last post by:

The “Add Web Reference” Visual tool generates bad classes (from WSDL schema) for ComplexType containing only one element (wsdl.exe and wseWsdl3.exe tools have the same problem) : if a ComplexType A contains only one element, the tool don’t generate a class for the ComplexType A. It generates a class only for the element type (B) included...

.NET Framework

1984

Problem generating Proxy Class from WSDL

by: bbalet.free.fr |last post by:

The “Add Web Reference” Visual tool generates bad classes (from WSDL schema) for ComplexType containing only one element (wsdl.exe and wseWsdl3.exe tools have the same problem) : if a ComplexType A contains only one element, the tool don’t generate a class for the ComplexType A. It generates a class only for the element type (B) included...

.NET Framework

10 1658

Using metaclasses to inherit class variables

by: telesphore4 |last post by:

I want to inherit fresh copies of some class variables. So I set up a metaclass and meddle with the class variables there. Now it would be convenient to run thru a dictionary rather than explicitly set each variable. However getattr() and setattr() are out because they chase the variable thru the class hierarchy. So, I read the dictionary...

Python

7857

What is ONU?

by: marktang |last post by:

ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...

General

8137

Problem With Comparison Operator <=> in G++

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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...

C / C++

8299

Maximizing Business Potential: The Nexus of Website Design and Digital Marketing

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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...

Online Marketing

8163

Discussion: How does Zigbee compare with other wireless protocols in smart home applications?

by: tracyyun |last post by:

Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...

General

5355

Couldn’t get equations in html when convert word .docx file to html file in C#.

by: conductexam |last post by:

I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...

C# / C Sharp

3813

Windows Forms - .Net 8.0

by: adsilva |last post by:

A Windows Forms form does not have the event Unload, like VB6. What one acts like?

Visual Basic .NET

1 2297

transfer the data from one system to another through ip address

by: 6302768590 |last post by:

Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

C# / C Sharp

1 1397

How to add payments to a PHP MySQL app.

by: muto222 |last post by:

How can i add a mobile payment intergratation into php mysql website.

PHP

1127

Comprehensive Guide to Website Development in Toronto: Expert Insights from BSMN Consultancy

by: bsmnconsultancy |last post by:

In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

General

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

To disable or enable advertisem*nts and analytics tracking please visit the page.

How to: class / type name | Bytes (2024)

References

Top Articles
Latest Posts
Article information

Author: Kieth Sipes

Last Updated:

Views: 6418

Rating: 4.7 / 5 (67 voted)

Reviews: 90% of readers found this page helpful

Author information

Name: Kieth Sipes

Birthday: 2001-04-14

Address: Suite 492 62479 Champlin Loop, South Catrice, MS 57271

Phone: +9663362133320

Job: District Sales Analyst

Hobby: Digital arts, Dance, Ghost hunting, Worldbuilding, Kayaking, Table tennis, 3D printing

Introduction: My name is Kieth Sipes, I am a zany, rich, courageous, powerful, faithful, jolly, excited person who loves writing and wants to share my knowledge and understanding with you.