Finding and Creating Assembly Types : Assembly « Development Class « C# / C Sharp

C# / C Sharp
1. 2D Graphics
2. Collections Data Structure
3. Components
4. Database ADO.net
5. Development Class
6. Event
7. File Stream
8. GUI Windows Form
9. Language Basics
10. Network
11. Office
12. Regular Expressions
13. Services Event
14. Thread
15. Web Services
16. Windows
17. XML
Microsoft Office Word 2007 Tutorial
Java
Java Tutorial
Java Source Code / Java Documentation
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
C# / CSharp Tutorial
ASP.Net
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
PHP
Python
SQL Server / T-SQL
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
C# / C Sharp » Development Class » AssemblyScreenshots 
Finding and Creating Assembly Types


using System;
using System.Reflection;
   
public class MainClass
{
    static void Main(string[] args)
    {
        Assembly XMLAssembly;
        Type[] XMLTypes;
   
        XMLAssembly = Assembly.Load("System.Xml, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089");
        XMLTypes = XMLAssembly.GetExportedTypes();
        foreach(Type XMLType in XMLTypes) {
            object NewObject;
            try {
                Console.Write(XMLType.ToString());
                NewObject = XMLAssembly.CreateInstance(XMLType.ToString());
                if(NewObject != null)
                    Console.WriteLine(" - Creation successful");
                else
                    Console.WriteLine(" - CREATION ERROR");
            catch(Exception e) {
                Console.WriteLine(" - EXCEPTION: {0}", e.Message);
            }
        }
    }
}
           
       
Related examples in the same category
1. Create assemblyCreate assembly
2. Examining Location InformationExamining Location Information
3. Working with an Assembly Entry PointWorking with an Assembly Entry Point
4. Loading Assemblies Dynamically with Load() and LoadWithPartialName()Loading Assemblies Dynamically with Load() and LoadWithPartialName()
5. Retrieving a List of Referenced Assemblies
6. Simple Windows Form Application with Version InformationSimple Windows Form Application with Version Information
7. Find Attribytes from assembly nameFind Attribytes from assembly name
8. Get current application domainGet current application domain
9. List All Types from an AssemblyList All Types from an Assembly
10. List All Members from an AssemblyList All Members from an Assembly
11. Use Assembly to indicate the version and cultureUse Assembly to indicate the version and culture
ww___w___.__jav_a___2s___._c__o_m__ | Contact Us
Copyright 2003 - 08 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.