| | |
Using Code Access Security (CAS) to programatically refuse writing to a drive - Shalvin
Please support our C# advertiser: Intel Parallel Studio Home
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)
using System.Security.Permissions; using System.Security; using System.IO; [assembly: FileIOPermissionAttribute(SecurityAction.RequestRefuse , Write="d:\\")] namespace WindowsFormsApplication1 { public partial class Form1 : Form { StreamWriter sw; private void button1_Click(object sender, EventArgs e) { sw = File.CreateText("d:\\Shalvin.txt"); sw.WriteLine("Hello"); sw.Close(); }
Similar Threads
- DVD-RW drive not writing nor burning (Storage)
- Drive Access Denied After Using USB Flash Drive (Storage)
- Getting a button's code to run programatically (VB.NET)
- Writing to hard drive? (C#)
| Thread Tools | Search this Thread |
.net access algorithm animation array barchart bitmap box broadcast c# check checkbox client combobox control conversion csharp custom customactiondata database datagrid datagridview dataset datastructure date/time datetime datetimepicker degrees development dll draganddrop drawing encryption enum event excel file filename files form format forms function gdi+ gis gtk hash image index input install java label list listbox mandelbrot math mouseclick mysql operator outlook2003 path photoshop picturebox pixelinversion pixelminversion post programming radians regex remoting richtextbox server sleep snooze socket sql statistics stream string table tables tcp text textbox thread time timer update usercontrol usercontrols validation visualstudio webbrowser webcam wia windows winforms wpf xml



