Hi everyone,
I am developing a "common repository" of methods which can be imported
into Windows and Web forms. However, I am having some troubles which I need
your help with!
1. Every property/function etc. has to be setup as Public Shared in the
common repository, or else the "main" application can't see the imported
functions (i.e. "Imports Common.Utilities"). I don't want "others" to get a
hold of this library and use it in their applications.
2. Which leads to the Code Application Security. Since I will be using
this in Windows forms and Web forms, I don't want someone to use my code to
create viruses, "attacks", etc. I need to lock this down so that only
projects that explicity import this can use it's functions, and only then
when it's one of my projects (I guess you could refer to that a local
machine??). In my actual applications, I want to again make sure that the
user has the proper rights to launch the program using CAS. Here's what
I've added to one of my applications so far:
<Assembly: UIPermissionAttribute(SecurityAction.RequestMinimu m,
Clipboard:=UIPermissionClipboard.OwnClipboard)>
<Assembly: UIPermission(SecurityAction.RequestMinimum,
Window:=UIPermissionWindow.AllWindows, Unrestricted:=True)>
For now, they don't need the ability to print or anything like that, but I
do need to see if they have access to the Excel automation object. This
application "imports" the "Common.Utilites" which accesses a SQL server
(i.e. the need to make sure it's secure!!).
I've searched the web, but am not finding really good examples (that are in
VB.NET) for how to really "lock-down" an application, or class library.
Last thing: I'm also a bit confused on when to create a module or a class?
What's the difference? Why should I choose to create a module vs a class
and vice-versa?
Thanks!
Chad