views:

35

answers:

2

Is it possible to prevent any unauthorised user to access code or application in desktop application like any web application? Thanks in advance.

A: 

You can use the imperative PrincipalPermission or the declarative PrincipalPermissionAttribute to assert that a user meets some authorization criteria to invoke a certain method or block of code.

This resource describes how to use this kind of security. In my experience, this pattern works best (where "best" means "easiest to set up") in an ActiveDirectory environment.

http://www.ginktage.com/2010/03/role-based-security-in-net/

kbrimington
A: 

If you want to protect your sourcecode, I would use an obfuscator like the free Eazfuscator.NET

http://www.foss.kharkov.ua/g1/projects/eazfuscator/dotnet/Default.aspx

Tobias Schittkowski