Click here to Skip to main content
Click here to Skip to main content
Add your own
alternative version
Go to top

The Windows Access Control Model Part 3

, 1 Jul 2005
In the third part of this series, we will take a tour of the new access control classes coming in .NET v2.0.
��namespace NetAccessControl

{

	partial class LowerRights

	{

		/// <summary>

		/// Required designer variable.

		/// </summary>

		private System.ComponentModel.IContainer components = null;



		/// <summary>

		/// Clean up any resources being used.

		/// </summary>

		/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>

		protected override void Dispose(bool disposing)

		{

			if (disposing && (components != null))

			{

				components.Dispose();

			}

			base.Dispose(disposing);

		}



		#region Windows Form Designer generated code



		/// <summary>

		/// Required method for Designer support - do not modify

		/// the contents of this method with the code editor.

		/// </summary>

		private void InitializeComponent()

		{

			this.openFileDialog1 = new System.Windows.Forms.OpenFileDialog();

			this.applicationEdit = new System.Windows.Forms.TextBox();

			this.Browsebutton = new System.Windows.Forms.Button();

			this.CloseButton = new System.Windows.Forms.Button();

			this.runButton = new System.Windows.Forms.Button();

			this.applicationLabel = new System.Windows.Forms.Label();

			this.enablePrivs = new System.Windows.Forms.CheckBox();

			this.saferSelect = new System.Windows.Forms.ComboBox();

			this.saferLbl = new System.Windows.Forms.Label();

			this.descriptiveLbl = new System.Windows.Forms.Label();

			this.cmdEdit = new System.Windows.Forms.TextBox();

			this.cmdLineLbl = new System.Windows.Forms.Label();

			this.SuspendLayout();

			// 

			// openFileDialog1

			// 

			this.openFileDialog1.FileName = "Select Executable";

			this.openFileDialog1.Filter = "Executables (*.exe, *.com, *.bat)|*.exe;*.com;*,bat;*.cmd;*.js|All Files (*.*)|*." +

				"*";

			// 

			// applicationEdit

			// 

			this.applicationEdit.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)

						| System.Windows.Forms.AnchorStyles.Right)));

			this.applicationEdit.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.FileSystemDirectories;

			this.applicationEdit.Location = new System.Drawing.Point(148, 37);

			this.applicationEdit.Name = "applicationEdit";

			this.applicationEdit.Size = new System.Drawing.Size(198, 20);

			this.applicationEdit.TabIndex = 2;

			this.applicationEdit.TextChanged += new System.EventHandler(this.applicationEdit_TextChanged);

			// 

			// Browsebutton

			// 

			this.Browsebutton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));

			this.Browsebutton.Location = new System.Drawing.Point(353, 35);

			this.Browsebutton.Name = "Browsebutton";

			this.Browsebutton.Size = new System.Drawing.Size(17, 23);

			this.Browsebutton.TabIndex = 3;

			this.Browsebutton.Text = "&...";

			this.Browsebutton.Click += new System.EventHandler(this.Browsebutton_Click);

			// 

			// CloseButton

			// 

			this.CloseButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));

			this.CloseButton.Location = new System.Drawing.Point(295, 153);

			this.CloseButton.Name = "CloseButton";

			this.CloseButton.Size = new System.Drawing.Size(75, 23);

			this.CloseButton.TabIndex = 8;

			this.CloseButton.Text = "&Close";

			this.CloseButton.Click += new System.EventHandler(this.CloseButton_Click);

			// 

			// runButton

			// 

			this.runButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));

			this.runButton.Enabled = false;

			this.runButton.Location = new System.Drawing.Point(214, 153);

			this.runButton.Name = "runButton";

			this.runButton.Size = new System.Drawing.Size(75, 23);

			this.runButton.TabIndex = 7;

			this.runButton.Text = "&Run...";

			this.runButton.Click += new System.EventHandler(this.runButton_Click);

			// 

			// applicationLabel

			// 

			this.applicationLabel.AutoSize = true;

			this.applicationLabel.Location = new System.Drawing.Point(83, 40);

			this.applicationLabel.Name = "applicationLabel";

			this.applicationLabel.Size = new System.Drawing.Size(58, 13);

			this.applicationLabel.TabIndex = 1;

			this.applicationLabel.Text = "&Application:";

			this.applicationLabel.TextAlign = System.Drawing.ContentAlignment.TopRight;

			// 

			// enablePrivs

			// 

			this.enablePrivs.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)

						| System.Windows.Forms.AnchorStyles.Right)));

			this.enablePrivs.AutoSize = true;

			this.enablePrivs.CheckAlign = System.Drawing.ContentAlignment.MiddleRight;

			this.enablePrivs.Location = new System.Drawing.Point(15, 89);

			this.enablePrivs.MinimumSize = new System.Drawing.Size(0, 32);

			this.enablePrivs.Name = "enablePrivs";

			this.enablePrivs.Size = new System.Drawing.Size(274, 32);

			this.enablePrivs.TabIndex = 4;

			this.enablePrivs.Text = "Run the program under the following restriction policy:";

			this.enablePrivs.CheckedChanged += new System.EventHandler(this.enablePrivs_CheckedChanged);

			// 

			// saferSelect

			// 

			this.saferSelect.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)

						| System.Windows.Forms.AnchorStyles.Right)));

			this.saferSelect.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;

			this.saferSelect.Enabled = false;

			this.saferSelect.FormattingEnabled = true;

			this.saferSelect.Location = new System.Drawing.Point(148, 121);

			this.saferSelect.Name = "saferSelect";

			this.saferSelect.Size = new System.Drawing.Size(222, 21);

			this.saferSelect.TabIndex = 6;

			// 

			// saferLbl

			// 

			this.saferLbl.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));

			this.saferLbl.AutoSize = true;

			this.saferLbl.Enabled = false;

			this.saferLbl.Location = new System.Drawing.Point(82, 124);

			this.saferLbl.Name = "saferLbl";

			this.saferLbl.Size = new System.Drawing.Size(60, 13);

			this.saferLbl.TabIndex = 5;

			this.saferLbl.Text = "&Safer Level:";

			this.saferLbl.TextAlign = System.Drawing.ContentAlignment.TopRight;

			// 

			// descriptiveLbl

			// 

			this.descriptiveLbl.AutoSize = true;

			this.descriptiveLbl.Location = new System.Drawing.Point(13, 13);

			this.descriptiveLbl.Name = "descriptiveLbl";

			this.descriptiveLbl.Size = new System.Drawing.Size(313, 13);

			this.descriptiveLbl.TabIndex = 0;

			this.descriptiveLbl.Text = "Specify a program to make it start with limited privileges and rights.";

			// 

			// cmdEdit

			// 

			this.cmdEdit.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)

						| System.Windows.Forms.AnchorStyles.Right)));

			this.cmdEdit.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.HistoryList;

			this.cmdEdit.Location = new System.Drawing.Point(148, 63);

			this.cmdEdit.Name = "cmdEdit";

			this.cmdEdit.Size = new System.Drawing.Size(221, 20);

			this.cmdEdit.TabIndex = 9;

			// 

			// cmdLineLbl

			// 

			this.cmdLineLbl.AutoSize = true;

			this.cmdLineLbl.Location = new System.Drawing.Point(12, 66);

			this.cmdLineLbl.Name = "cmdLineLbl";

			this.cmdLineLbl.Size = new System.Drawing.Size(129, 13);

			this.cmdLineLbl.TabIndex = 10;

			this.cmdLineLbl.Text = "Command Line Arguments:";

			// 

			// LowerRights

			// 

			this.AllowDrop = true;

			this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);

			this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;

			this.ClientSize = new System.Drawing.Size(382, 188);

			this.Controls.Add(this.cmdLineLbl);

			this.Controls.Add(this.cmdEdit);

			this.Controls.Add(this.descriptiveLbl);

			this.Controls.Add(this.saferLbl);

			this.Controls.Add(this.saferSelect);

			this.Controls.Add(this.enablePrivs);

			this.Controls.Add(this.applicationLabel);

			this.Controls.Add(this.runButton);

			this.Controls.Add(this.CloseButton);

			this.Controls.Add(this.Browsebutton);

			this.Controls.Add(this.applicationEdit);

			this.MinimumSize = new System.Drawing.Size(350, 215);

			this.Name = "LowerRights";

			this.Text = "LowerRights";

			this.Load += new System.EventHandler(this.LowerRights_Load);

			this.DragEnter += new System.Windows.Forms.DragEventHandler(this.LowerRights_DragEnter);

			this.DragDrop += new System.Windows.Forms.DragEventHandler(this.LowerRights_DragDrop);

			this.ResumeLayout(false);

			this.PerformLayout();



		}



		#endregion



		private System.Windows.Forms.OpenFileDialog openFileDialog1;

		private System.Windows.Forms.TextBox applicationEdit;

		private System.Windows.Forms.Button Browsebutton;

		private System.Windows.Forms.Button CloseButton;

		private System.Windows.Forms.Button runButton;

		private System.Windows.Forms.Label applicationLabel;

		private System.Windows.Forms.CheckBox enablePrivs;

		private System.Windows.Forms.ComboBox saferSelect;

		private System.Windows.Forms.Label saferLbl;

		private System.Windows.Forms.Label descriptiveLbl;

		private System.Windows.Forms.TextBox cmdEdit;

		private System.Windows.Forms.Label cmdLineLbl;

	}

}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here

Share

About the Author

oshah
Web Developer
United States United States
Mr. Shah is a reclusive C++/C# developer lurking somewhere in the depths of the city of London. He learnt physics at Kings' College London and obtained a Master in Science there. Having earned an MCAD, he teeters on the brink of transitioning from C++ to C#, unsure of which language to jump to. Fortunately, he also knows how to use .NET interop to merge code between the two languages (which means he won't have to make the choice anytime soon).
 
His interests (apart from programming) are walking, football (the real one!), philosophy, history, retro-gaming, strategy gaming, and any good game in general.
 
He maintains a website / blog / FAQ / junk at shexec32.serveftp.net, where he places the best answers he's written to the questions you've asked. If you can find him, maybe you can hire Mr. Shah to help you with anything C++[/CLI]/C#/.NET related Smile | :) .

| Advertise | Privacy | Mobile
Web04 | 2.8.140922.1 | Last Updated 1 Jul 2005
Article Copyright 2005 by oshah
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid