using reflection fine the current namespace

  • Thread starter Thread starter puzzlecracker
  • Start date Start date
P

puzzlecracker

Can I find classe's namespace

class Foo{

Foo (){

String namespaceName =/*Get namespace*/
}

}


Thanks
 
Can I find classe's namespace

class Foo{

   Foo (){

     String namespaceName =/*Get namespace*/
   }

}

Within an instance method or constructor, you can call
GetType().Namespace.
In a static context, you need typeof(Foo).Namespace

Jon
 
Back
Top