Professional Web Applications Themes

Accessing all properties of an object at Runtime - ASP.NET General

Use reflection... "Softwaremaker" <msdnremovethis.softwaremaker.net> wrote in message news:<#b1mBjhQDHA.2432TK2MSFTNGP10.phx.gbl>... > Hi Fellow developers, > > What is the recommended method to display a list of all properties of an > object at Runtime > > Public Function CompareObj _ > > (ByVal NewObject As Object, ByVal SrcObject As Object) As Boolean > > End Function > > I want to be able to access all the property name and their values at > runtime. > > How do I do that ? > > Any help is appreciated. > > Thank You....

  1. #1

    Default Re: Accessing all properties of an object at Runtime

    Use reflection...

    "Softwaremaker" <msdnremovethis.softwaremaker.net> wrote in message news:<#b1mBjhQDHA.2432TK2MSFTNGP10.phx.gbl>...
    > Hi Fellow developers,
    >
    > What is the recommended method to display a list of all properties of an
    > object at Runtime
    >
    > Public Function CompareObj _
    >
    > (ByVal NewObject As Object, ByVal SrcObject As Object) As Boolean
    >
    > End Function
    >
    > I want to be able to access all the property name and their values at
    > runtime.
    >
    > How do I do that ?
    >
    > Any help is appreciated.
    >
    > Thank You.
    Ilyas Guest

  2. #2

    Default Re: Accessing all properties of an object at Runtime

    Hi,

    Thanks for the reply. But could you point me to something more informative.

    Thanks

    Willie

    +++++++++++++++++
    "Ilyas" <ilyasigsoftwaresolutions.co.uk> wrote in message
    news:34a10b47.0307040749.6ab37825posting.google.c om...
    > Use reflection...
    >
    > "Softwaremaker" <msdnremovethis.softwaremaker.net> wrote in message
    news:<#b1mBjhQDHA.2432TK2MSFTNGP10.phx.gbl>...
    > > Hi Fellow developers,
    > >
    > > What is the recommended method to display a list of all properties of an
    > > object at Runtime
    > >
    > > Public Function CompareObj _
    > >
    > > (ByVal NewObject As Object, ByVal SrcObject As Object) As Boolean
    > >
    > > End Function
    > >
    > > I want to be able to access all the property name and their values at
    > > runtime.
    > >
    > > How do I do that ?
    > >
    > > Any help is appreciated.
    > >
    > > Thank You.

    Softwaremaker Guest

  3. #3

    Default RE: Accessing all properties of an object at Runtime

    Hello William,

    Assemblies contain modules, modules contain types, and types contain
    members. Reflection provides objects that encapsulate assemblies, modules,
    and types. You can use reflection to dynamically create an instance of a
    type, bind the type to an existing object, or get the type from an existing
    object. You can then invoke the type's methods or access its fields and
    properties. For an example, we could use Reflection.PropertyInfo to
    discover information such as the name, data type, declaring type, reflected
    type, and read-only or writable status of a property, and to get or set
    property values.

    For details, please refer to MSDN topic "Discovering Type Information at
    Run Time"
    [url]http://msdn.microsoft.com/library/en-us/cpguide/html/cpcondiscoveringtypeinf[/url]
    ormationatruntime.asp?frame=true

    Hope it helps.

    Best regards,
    yhhuang
    VS.NET, Visual C++
    Microsoft

    This posting is provided "AS IS" with no warranties, and confers no rights.
    Got .Net? [url]http://www.gotdotnet.com[/url]
    --------------------
    !From: "Softwaremaker" <msdnremovethis.softwaremaker.net>
    !Subject: Accessing all properties of an object at Runtime
    !Date: Fri, 4 Jul 2003 18:40:55 +0800
    !Lines: 29
    !X-Priority: 3
    !X-MSMail-Priority: Normal
    !X-Newsreader: Microsoft Outlook Express 6.00.2800.1106
    !X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106
    !Message-ID: <#b1mBjhQDHA.2432TK2MSFTNGP10.phx.gbl>
    !Newsgroups: microsoft.public.dotnet.framework.aspnet
    !NNTP-Posting-Host: bb-203-125-116-38.singnet.com.sg 203.125.116.38
    !Path: cpmsftngxa09.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTN GP10.phx.gbl
    !Xref: cpmsftngxa09.phx.gbl microsoft.public.dotnet.framework.aspnet:32281
    !X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
    !
    !Hi Fellow developers,
    !
    !What is the recommended method to display a list of all properties of an
    !object at Runtime
    !
    !Public Function CompareObj _
    !
    !(ByVal NewObject As Object, ByVal SrcObject As Object) As Boolean
    !
    !End Function
    !
    !I want to be able to access all the property name and their values at
    !runtime.
    !
    !How do I do that ?
    !
    !Any help is appreciated.
    !
    !Thank You.
    !
    !--
    !William T
    !Chief Software Developer
    !Software Architect
    !Softwaremaker.Net Pte Ltd
    !
    !+++++++++++++++++++++++++++++
    !
    !
    !

    Yan-Hong Huang[MSFT] Guest

Similar Threads

  1. Accessing COM properties that take arguments
    By Jim@Abcam in forum Coldfusion - Advanced Techniques
    Replies: 0
    Last Post: July 11th, 04:27 PM
  2. Changing movie properties in runtime
    By seahr in forum Macromedia Flash Ad Development
    Replies: 0
    Last Post: March 28th, 04:55 AM
  3. Accessing the visible property of a User Control at runtime
    By johnStein in forum ASP.NET Building Controls
    Replies: 1
    Last Post: May 24th, 06:01 AM
  4. accessing non-linked external casts in runtime
    By vbarberini webforumsuser@macromedia.com in forum Macromedia Director Lingo
    Replies: 2
    Last Post: July 16th, 01:09 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139