What is Code-Access security? - C#.NET

What is Code-Access security?

Code access security is a mechanism that helps limit the access to the code by protecting the resources. It defines permissions which tell about the rights to access various. It also imposes restrictions on code at run time.

Code:
using System;
namespace ConsoleReadRegistry
{
   class SecurityClass
   {
       [STAThread]
       static void Main(string[] args)
       {
           Microsoft.Win32.RegistryKey regKey;
           try
           {
               regKey =Microsoft.Win32.Registry.LocalMachine.OpenSubKey
               ("Software\\Microsoft\\.NetFramework",false);
               string[] skNames = regKey.GetSubKeyNames();
               for (int i=0;i<skNames.Length;++i)
               {
                   Console.WriteLine("Registry Key: {0}", skNames[i]);
               }
               regKey.Close();
           }
           catch(System.Security.SecurityException e)
           {
               Console.WriteLine("Security Exception Encountered: {0}", e.Message);
           }
       }
   }
}
What is Role-based security? - C#.NET
What is Role-based security? - Application that provide access to its data based on credentials check, verify the user’s role...
Steps to deploy an XML web service - C#.NET
Explain steps to deploy an XML web service - To deploy the XML Web service, once can add a Web Setup project using project templates...
Steps to secure an XML web service - C#.NET
Steps to secure an XML web service - a) Secure the transport layer...
Post your comment