|
ms
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
retreiving namespace using Reflection | BeginnersHi,
I want to retreive different namespaces available within an Assembly using Reflection. Is this possible? Can i retreive a namespace within an Assembly using " Type " ? My question is how can we retreive a namespace from an Assembly? For example, i can see different namespaces with " mscorlib" assembly then how can retreive namespaces within mscorlib? Pardon my ignorance and please enlighten me. Thanks in advance. -Erland take a look here
http://msdn2.microsoft.com/en-us/library/system.reflection.assembly.gettypes.aspx you can get name of returned types' FullName property (as you know it will start with Namespace) you can perform custom parsing to get what you need this is the code for getting all types in executing assembly - you must have windows forms applciation with TextBox called textBox1 (Multiline property is set to true) System.Reflection.Assembly asm = Assembly.GetExecutingAssembly(); Type[] types = asm.GetTypes(); for (int i = 0; i < types.GetLength(0); i++) { textBox1.Text = string.Format("{0}{1}{2}", textBox1.Text, types[i].FullName, Environment.NewLine); } I hope this helps Galin Iliev[MCSD.NET] www.galcho.com
ListView problem
How to reboot at end of deployment Repeating a character X number of times? Cursor Position in KeyPressEvent Reflection, how to? C# on multicore regex high cpu utilization OpenFileDialog - MyComputer Validating size of image before uploading to database form.showDialog() does not work properly |
|||||||||||||||||||||||