Using a class file / link?
4 answers
Well, in your class file, you have the following:
namespace myNamespace
{
public class MyClass
{
public void MyMethod() { }
}
}
Let's assume you have this in an assembly named MyDll.dll
. You would use it like this:
- You add a link to
MyDll.dll
in the solution explorer - You include the namespace with
using myNamespace;
- Then you can use your class by doing
MyClass test = new MyClass();
If you didn't add a namespace like I said in 2., you would use your class:
myNamespace.MyClass test = new myNamespace.MyClass();
+10
source to share