| using System;
|
| 1:using System.Reflection;
|
| 2:
|
| 3:namespace ETG.Base.Applications.ETigers.Web.ETech.CSharp
|
| 4:{
|
| 5: public class ManifestMetadata
|
| 6: {
|
| 7: public ManifestMetadata()
|
| 8: {
|
| 9: //
|
| 10: // TODO: Add constructor logic here
|
| 11: //
|
| 12: }
|
| 13:
|
| 14:
|
| 15: public static void LoadAssemblyManifest()
|
| 16: {
|
| 17: Assembly objAsmb = Assembly.LoadFile(@"C:MyProj\\bin\\MyProj.dll");
|
| 18:
|
| 19: Console.WriteLine("\n Types");
|
| 20: Console.WriteLine("=====================");
|
| 21: Type[] Types = objAsmb.GetTypes();
|
| 22: foreach (Type oType in Types)
|
| 23: {
|
| 24: Console.WriteLine(oType.Name.ToString());
|
| 25: }
|
| 26:
|
| 27:
|
| 28: Console.WriteLine("\n Manifest");
|
| 29: Console.WriteLine("=====================");
|
| 30: string[] strManifest = objAsmb.GetManifestResourceNames();
|
| 31: foreach (string str in strManifest)
|
| 32: {
|
| 33: Console.WriteLine(str);
|
| 34: Console.WriteLine("------Manifest resource info start-------");
|
| 35: ManifestResourceInfo objMInfo = objAsmb.GetManifestResourceInfo(str);
|
| 36: Console.WriteLine(objMInfo.FileName);
|
| 37: Assembly refAsmb = objMInfo.ReferencedAssembly;
|
| 38: if (!object.Equals(refAsmb, null))
|
| 39: {
|
| 40: Console.WriteLine("Refference assembly name");
|
| 41: Console.WriteLine(refAsmb.FullName);
|
| 42: Console.WriteLine(refAsmb.Location);
|
| 43: }
|
| 44: Console.WriteLine(objMInfo.ResourceLocation);
|
| 45: Console.WriteLine("------Manifest resource info End-------");
|
| 46:
|
| 47: }
|
| 48: Console.WriteLine(objAsmb.FullName);
|
| 49: Console.Read();
|
| 50:
|
| 51: }
|
| 52: }
|
| 53:}
|
| 54: |