473,408 Members | 2,888 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,408 software developers and data experts.

What is equivelant to VB.NET GetType()

Using this keyword in VB I can do

Dim typeData As Type = GetType(myClass)

which returns a Type of course. I can't find quite the same thing in C# or
the framework.

Will the following meet the needs like the above VB code? (If so, then why
the keyword in VB???)

Type typeData = Type.GetType("myClass")
Nov 15 '05 #1
3 4530
Hi Daniel!

use typeof()

--
Best Regards
Yanick Lefebvre

Please posts answers to the group so all can benefit
Nov 15 '05 #2
If "myClass" is the name of your class, you can use typeof(myClass). If
it's an instance of your class, you can use myClass.GetType().

"Daniel Billingsley" <db**********@NO.durcon.SPAAMM.com> wrote in message
news:eI*************@tk2msftngp13.phx.gbl...
Using this keyword in VB I can do

Dim typeData As Type = GetType(myClass)

which returns a Type of course. I can't find quite the same thing in C# or the framework.

Will the following meet the needs like the above VB code? (If so, then why the keyword in VB???)

Type typeData = Type.GetType("myClass")

Nov 15 '05 #3
Thanks to both of you, that worked poifect.

Pardon me for being a bit misleading... I should have used MyClass as I
indeed meant to refer to the class, not an instance object.

"Bret Mulvey [MS]" <br***@online.microsoft.com> wrote in message
news:%2***************@TK2MSFTNGP10.phx.gbl...
If "myClass" is the name of your class, you can use typeof(myClass). If
it's an instance of your class, you can use myClass.GetType().

Nov 15 '05 #4

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

Similar topics

3
by: Alex Hunsley | last post by:
Pretty simple seeming question, but can't find answer via google or docs... I am using urllib2 as follows: handle = urlopen(req, postdata) # and URL to return a handle on ... print...
0
by: hsifelbmur | last post by:
does anyone know a product equivelant to MS SQL Server Reporting Services, but for MySQL or PostGreSQL?
2
by: Chris LaJoie | last post by:
I'm converting some APIs to C# and I'm wondering what the equivelant of a DWORD is. I'm thinking it's a uint, but I'm uncertiain. Can anyone confirm that? Chris
5
by: Torben S. Petersen | last post by:
Hi, I am currently trying to re-write some VC++ code into C# but are having problems finding a way to convert the C++ memcpy into C#. The following is part of the code: ...
2
by: ad | last post by:
There are InStr in VB What is the C# equivelant of the function InStr in VB? ---------------------------------------------------------------------------- ------------------ SearchString...
3
by: Ant | last post by:
Hi there, Is there an equivelant in C# to the VB: With controlName .property = X .Method End with Thanks very much in advance Ant
1
by: Tim Kelley | last post by:
Is there an equivelant to the vb6 app.name in c#? Thanks
47
by: Nathan Sokalski | last post by:
VB.NET has a function, Asc(), that gets the Ascii value of a character. I am attempting to find an equivelant function for C#. Can somebody help me here? -- Nathan Sokalski njsokalski@hotmail.com...
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: 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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
marktang
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,...
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.