locked
read code from dll file RRS feed

  • Question

  • Hi
    i created this class
    Imports System

    Namespace myComponents

    Public Class Quote

      Dim myRand As New Random

      Public Function ShowQuote() As String
        Select myRand.Next( 3 )
          Case 0
            Return "Look before you leap"
          Case 1
            Return "Necessity is the mother of invention"
          Case 2
            Return "Life is full of risks"
        End Select
      End Function

    End Class

    End Namespace

    ANd i created dll file from this class
    using
    D: vbc /t:library quote.vb

    Dll file is created

    and i added to my app s bin directory adn i used this class

    Now here what i  need  is it is possible to read code again from this created dll file

    adil
    Wednesday, June 3, 2009 2:24 PM

Answers

  • Once you compile the code into a class library you wont be able to read the code from it.
    As you said you can add that dll into your application and you can consume it.

    If you want to see the code, then you need to use tools like reflector to achieve the same.

    If you are looking for dynamically loading the dll you are use reflection. But as far as what you have done i dont think reflection is required. You can add the reference and use the dll.

    Hope this is what you are looking for.
    Thanks,
    A.m.a.L
    .Net Goodies
    Remember to click "mark as answered" when you get a correct reply to your question
    Wednesday, June 3, 2009 2:34 PM

All replies

  • Once you compile the code into a class library you wont be able to read the code from it.
    As you said you can add that dll into your application and you can consume it.

    If you want to see the code, then you need to use tools like reflector to achieve the same.

    If you are looking for dynamically loading the dll you are use reflection. But as far as what you have done i dont think reflection is required. You can add the reference and use the dll.

    Hope this is what you are looking for.
    Thanks,
    A.m.a.L
    .Net Goodies
    Remember to click "mark as answered" when you get a correct reply to your question
    Wednesday, June 3, 2009 2:34 PM
  • The answer is "yes". There are any number of tools by which it can be de-compiled.

    http://www.4guysfromrolla.com/articles/080404-1.aspx


    Paul ~~~~ Microsoft MVP (Visual Basic)
    Wednesday, June 3, 2009 3:05 PM