Restricting code access

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • RA

    Restricting code access

    How can I have a resticted access to assembly? I want onlt code I am writing
    to be able to access my assemblys.

    Thanks,
    Ron


  • Madhu [MVP]

    #2
    Restricting code access

    Hi,

    One solution may to create a strong name for your
    assemblies.
    And inside your code do the following,

    1) create the permissionset object.
    2) create the StrongNameIdent ityPermission with the
    public key you have used in your assemblies.
    3) Add the StrongNameIdent ityPermission to the
    permissionset object.
    4) Call the Demand method, thus insuring all the callers
    have the same strong name which essentially means all
    your assemblies.

    Also, you can look at the security tutorial which should
    give you a jump start on Code Access Security..


    url=/library/en-us/csref/html/vcwlksecuritytu torial.asp

    Hope this helps...

    Regards,
    Madhu

    MVP | MCSD.NET
    [color=blue]
    >-----Original Message-----
    >How can I have a resticted access to assembly? I want[/color]
    onlt code I am writing[color=blue]
    >to be able to access my assemblys.
    >
    >Thanks,
    >Ron
    >
    >
    >.
    >[/color]

    Comment

    Working...