Quantcast
Channel: VBForums
Viewing all articles
Browse latest Browse all 42220

Using System.Reflection

$
0
0
Need help/example of using system.reflection, code below.

Code:

Imports System.Reflection
Public Class Form1
    Private Sub b1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles b1.Click
        Try
            Dim nasm As Assembly = Assembly.LoadFrom(t1.Text) ' C:\Windows\System32\notepad.exe
            Dim w As New List(Of String)
            Try
                w.Add(nasm.CodeBase.ToString)
                w.Add(vbCrLf)
            Catch
            End Try
            r1.Lines = w.ToArray
        Catch
            MsgBox(ErrorToString)
        End Try
    End Sub
End Class

Error: Could not load file or assembly 'file:///C:\Windows\System32\notepad.exe' or one of it's dependencies. The module was expected to contain an assembly manifest.

Trying: When b1 Is Clicked, I Would Like It To Load The File From The t1, And Display The Information In r1. (b1=button1/t1=textbox1/r1=richtextbox1)

Help appreciated, Thanks

Viewing all articles
Browse latest Browse all 42220

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>