Click here to Skip to main content
15,896,207 members
Articles / Programming Languages / Visual Basic

Dynamic Console App for Invoking .NET Assemblies

Rate me:
Please Sign up or sign in to vote.
4.38/5 (4 votes)
18 Oct 2007CPOL3 min read 37.6K   188   24  
This application demonstrates how .NET Reflection can be used to Query and Invoke Any Assemblies Methods.
Imports System.IO

Public Class MessageHandler

    Private _x As Integer
    Private _y As Integer

    Public Property x() As Integer
        Get
            Return Me._x
        End Get
        Set(ByVal value As Integer)
            Me._x = value
        End Set
    End Property

    Public Property y() As Integer
        Get
            Return Me._y
        End Get
        Set(ByVal value As Integer)
            Me._y = value
        End Set
    End Property

    Public Function GetSystemTime() As DateTime
        Return DateTime.Now
    End Function

    Public Function Add(ByVal x As Decimal, ByVal y As Decimal) As Decimal
        Return x + y
    End Function

    Public Function GetFileSize(ByVal fileName As String, ByVal fileType As Integer) As Long
        Dim fInfo As New FileInfo(fileName)

        Return fInfo.Length
    End Function

    Public Function ReturnCustomerObject(ByVal fileName As String) As ReturnValue
        Return New ReturnValue("This is a custom Object")
    End Function

    Public Function ReturnList(ByVal lastEliment As String) As List(Of String)
        Dim obj As New List(Of String)(10)

        obj.Add("this")
        obj.Add("list")
        obj.Add("custom")
        obj.Add("objects")
        obj.Add("recursive")
        obj.Add("comments")
        obj.Add(lastEliment)

        Return obj
    End Function

    Public Sub New()

    End Sub

    Public Sub New(ByVal x As Integer, ByVal y As Integer)
        Me._x = x
        Me._y = y
    End Sub
End Class

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Architect
Canada Canada
Engineer, maker, food lover

Comments and Discussions