Accessing all properties of an object at Runtime

Ask a Question related to ASP.NET General, Design and Development.

  1. #1

    Default Re: Accessing all properties of an object at Runtime

    Use reflection...

    "Softwaremaker" <msdn@removethis.softwaremaker.net> wrote in message news:<#b1mBjhQDHA.2432@TK2MSFTNGP10.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. Similar Questions and Discussions

    1. Accessing the Field of a Bind Expression at runtime.
      Greetings I'm currently attempting to write a control that will extend functionality of databound controls (ie TextBox etc). However, while I can...
    2. Accessing COM properties that take arguments
      sorry if this has been covered before, but I have an external COM object which has properties that require arguments... e.g. to write a property I...
    3. Changing movie properties in runtime
      Hello, Can anyone help me with this unusual task. I am loading and .swf in another file on frame event, the .swf can have any frame rate, stage...
    4. Accessing the visible property of a User Control at runtime
      I need to make visisble/invisible my user control at runtime I am using code-behind and there is no access to the control here What do I do
    5. accessing non-linked external casts in runtime
      Is it possible to access a cast that is not linked to a movie? Can anyone tell me how? thanks J
  3. #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" <ilyas@igsoftwaresolutions.co.uk> wrote in message
    news:34a10b47.0307040749.6ab37825@posting.google.c om...
    > Use reflection...
    >
    > "Softwaremaker" <msdn@removethis.softwaremaker.net> wrote in message
    news:<#b1mBjhQDHA.2432@TK2MSFTNGP10.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

  4. #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" <msdn@removethis.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.2432@TK2MSFTNGP10.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

Posting Permissions

  • You may not post new threads
  • You may 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