c# - How to access a function within a namespace -
please facing problem while accessing function within class inside namespace in c#.
the format know follows: namespace.classname.functionname();
however, above method reporting me following error:
an object reference required non-static field, method or property "namespace.classname.functionname()".
you need declare instance of class contains function
namespace.classname yourclass = new namespace.classname();
then can use function follows
yourclass.functionname();
if want able use function without declaring instance of class needs static funciton.
Comments
Post a Comment