Saqib Ullah

BootStrapper Know How

  Home  |   Contact  |   Syndication    |   Login
  93 Posts | 1 Stories | 341 Comments | 15 Trackbacks

News



Article Categories

Archives

Post Categories

Blogging websites

Favourite Blogs

Private Links

Sites

This is my first coding blog for IronPython in which I convert my old blog List of all Form from an Assembly in IronPython code. I use Visual Studio 2005 IronPython Console template so you need to add the following lines of code explicitly when use are writing code on command prompt to add reference of System.dll

import clr

clr.AddReference("System")

Here are the few bytes that IronPython developers use when they want to get a list of types from particular assembly.

from System import *
from System.Reflection import *

def GetTypeList(assemblyName, assemblyVersion):

    _assemblyname = AssemblyName()   

    _assemblyname.Name = assemblyName   

    v = Version(assemblyVersion) 

    _assemblyname.Version = v;   

    assembly = Assembly.Load(_assemblyname)   

    Console.WriteLine("Listing all types in {0}", assembly.FullName) 

    Console.WriteLine()   

    types = assembly.GetTypes()   

    for type in types:
           Console.WriteLine(type)

GetTypeList('IronMath.dll','1.1.0.0')
Console.ReadLine();

In the preceding codes I test the IronMath.dll itself with it version ‘1.1.0.0’. For C# version of this code read this blog.

posted on Sunday, February 17, 2008 10:25 AM

Feedback

# re: Get list of types from assembly in IronPython 9/13/2008 5:41 PM Mp3 Film Program Download
Thanks h

Post A Comment
Title:
Name:
Email:
Website:
Comment:
Verification: