Click here to Skip to main content
15,887,906 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi All,

I want to use my class library only in my project.
I don't want other can use my class library.
Any body can help me?

Thanks
Posted

Instead of declaring your methods public declare them as internal.

Do some research into variable scoping.
 
Share this answer
 
Comments
HI_Friend 19-Dec-12 23:11pm    
I'm a new programmer so let u detail more than this
or do u have for example for me?
Dont share it!! Hide it somewhere so that none could find your dll.

You may use internal access specifier but since you said its a class library you definitely need to expose some of your classes as Public, so if someone referring the dll can access what ever the data you declared as public.

but if the classes are used inside a dll (class library) you can use define the class as internal
eg:
C#
internal class MyClass
{
 internal bool CanYouSeeMe
 {
  get;
  set;
 }
}

Read more about Access Specifiers in C# @ MSDN[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900