User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the C# section within the Software Development category of DaniWeb, a massive community of 374,571 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,550 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our C# advertiser:
Feb 26th, 2008
Views: 1,288
CAS is the programatically means by which you secure the resouce of a system like file system, printer, registry, etc. in contrast to Role Base Security (RBS)
Last edited : Mar 26th, 2008.
csharp Syntax
  1. using System.Security.Permissions;
  2. using System.Security;
  3. using System.IO;
  4.  
  5. [assembly: FileIOPermissionAttribute(SecurityAction.RequestRefuse , Write="d:\\")]
  6. namespace WindowsFormsApplication1
  7. {
  8. public partial class Form1 : Form
  9. {
  10. StreamWriter sw;
  11. private void button1_Click(object sender, EventArgs e)
  12. {
  13. sw = File.CreateText("d:\\Shalvin.txt");
  14. sw.WriteLine("Hello");
  15. sw.Close();
  16. }
Post Comment

Only community members can submit or comment on code snippets. You must register or log in to contribute.

DaniWeb Marketplace (Sponsored Links)
All times are GMT -4. The time now is 5:45 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC