TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
kobus_2000
NA
14
0
Getting value with Reflection?
Jul 25 2005 1:23 AM
Hi
If I have a class Person eg:
Class Person
{
private int identity;
public int Identity
{
get
return this.identity;
set
this.identity = value;
}
How can I get the value of identity (for example) using Reflection if I use the following type of code.
Person person = new Person();
this.DoSomething(person);
public void DoSomething(object obj)
{
//int identity = ???????;
Console.Writeline("Identity = " + identity);
}
}
I tried using the Type.PropertyInfo and GetValue, but the help documentation is not that clear and I did not manage.
Can anybody help me with an example perhaps.
Thanks.
Kobus
Reply
Answers (
1
)
How To Concatenate RTF To Somple Text
ODBC .net help