using System;
using System.Reflection;
using System.Collections.Generic;
class MainClass
{
public static void Main(string[] args)
{
AssemblyName assembly1 = new AssemblyName("com.microsoft.crypto, Culture=en, PublicKeyToken=a5d015c7d5a0b012, Version=1.0.0.0");
Dictionary<string, AssemblyName> assemblyDictionary = new Dictionary<string, AssemblyName>();
assemblyDictionary.Add("Crypto", assembly1);
AssemblyName ass1 = assemblyDictionary["Crypto"];
Console.WriteLine("Got AssemblyName from dictionary: {0}", ass1);
List<AssemblyName> assemblyList = new List<AssemblyName>();
assemblyList.Add(assembly1);
AssemblyName ass2 = assemblyList[0];
Console.WriteLine("\nFound AssemblyName in list: {0}", ass1);
Stack<AssemblyName> assemblyStack = new Stack<AssemblyName>();
assemblyStack.Push(assembly1);
AssemblyName ass3 = assemblyStack.Pop();
Console.WriteLine("\nPopped AssemblyName from stack: {0}", ass1);
}
}
|