Click here to Skip to main content
15,885,309 members
Articles / Programming Languages / Visual Basic

The Windows Access Control Model Part 3

Rate me:
Please Sign up or sign in to vote.
4.80/5 (28 votes)
1 Jul 200525 min read 232.5K   5.2K   126  
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 AccCheckFrm
	{
		/// <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.AccessCheckButton = new System.Windows.Forms.Button();
			this.exitButton = new System.Windows.Forms.Button();
			this.descriptiveLbl = new System.Windows.Forms.Label();
			this.regKeyEdit = new System.Windows.Forms.TextBox();
			this.regKeyLbl = new System.Windows.Forms.Label();
			this.actionDescLbl = new System.Windows.Forms.Label();
			this.accessMaskEdit = new System.Windows.Forms.TextBox();
			this.accessMaskLbl = new System.Windows.Forms.Label();
			this.manualCheckButton = new System.Windows.Forms.Button();
			this.statusBar2 = new System.Windows.Forms.StatusStrip();
			this.statusLabelb1 = new System.Windows.Forms.ToolStripStatusLabel();
			this.statusBar2.SuspendLayout();
			this.SuspendLayout();
			// 
			// AccessCheckButton
			// 
			this.AccessCheckButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
			this.AccessCheckButton.Enabled = false;
			this.AccessCheckButton.Location = new System.Drawing.Point(14, 140);
			this.AccessCheckButton.Name = "AccessCheckButton";
			this.AccessCheckButton.Size = new System.Drawing.Size(100, 23);
			this.AccessCheckButton.TabIndex = 6;
			this.AccessCheckButton.Text = "A&ccessCheck";
			this.AccessCheckButton.Click += new System.EventHandler(this.AccessCheckButton_Click);
			// 
			// exitButton
			// 
			this.exitButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
			this.exitButton.Location = new System.Drawing.Point(226, 140);
			this.exitButton.Name = "exitButton";
			this.exitButton.Size = new System.Drawing.Size(100, 23);
			this.exitButton.TabIndex = 8;
			this.exitButton.Text = "&Cancel";
			this.exitButton.Click += new System.EventHandler(this.exitButton_Click);
			// 
			// 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(321, 13);
			this.descriptiveLbl.TabIndex = 0;
			this.descriptiveLbl.Text = "Type in your HKLM registry key to see if you will be granted access.";
			// 
			// regKeyEdit
			// 
			this.regKeyEdit.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
						| System.Windows.Forms.AnchorStyles.Right)));
			this.regKeyEdit.Location = new System.Drawing.Point(102, 42);
			this.regKeyEdit.Name = "regKeyEdit";
			this.regKeyEdit.Size = new System.Drawing.Size(224, 20);
			this.regKeyEdit.TabIndex = 2;
			this.regKeyEdit.TextChanged += new System.EventHandler(this.regKeyEdit_TextChanged);
			// 
			// regKeyLbl
			// 
			this.regKeyLbl.AutoSize = true;
			this.regKeyLbl.Location = new System.Drawing.Point(31, 45);
			this.regKeyLbl.Name = "regKeyLbl";
			this.regKeyLbl.Size = new System.Drawing.Size(65, 13);
			this.regKeyLbl.TabIndex = 1;
			this.regKeyLbl.Text = "&Registry Key:";
			this.regKeyLbl.TextAlign = System.Drawing.ContentAlignment.TopRight;
			// 
			// actionDescLbl
			// 
			this.actionDescLbl.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
						| System.Windows.Forms.AnchorStyles.Left)
						| System.Windows.Forms.AnchorStyles.Right)));
			this.actionDescLbl.Location = new System.Drawing.Point(12, 92);
			this.actionDescLbl.Name = "actionDescLbl";
			this.actionDescLbl.Size = new System.Drawing.Size(313, 45);
			this.actionDescLbl.TabIndex = 5;
			this.actionDescLbl.Text = "The security descriptor will be checked against your user name to see if you will" +
				" be granted the specified action";
			// 
			// accessMaskEdit
			// 
			this.accessMaskEdit.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
						| System.Windows.Forms.AnchorStyles.Right)));
			this.accessMaskEdit.Location = new System.Drawing.Point(102, 69);
			this.accessMaskEdit.Name = "accessMaskEdit";
			this.accessMaskEdit.Size = new System.Drawing.Size(224, 20);
			this.accessMaskEdit.TabIndex = 4;
			this.accessMaskEdit.TextChanged += new System.EventHandler(this.regKeyEdit_TextChanged);
			// 
			// accessMaskLbl
			// 
			this.accessMaskLbl.AutoSize = true;
			this.accessMaskLbl.Location = new System.Drawing.Point(16, 72);
			this.accessMaskLbl.Name = "accessMaskLbl";
			this.accessMaskLbl.Size = new System.Drawing.Size(80, 13);
			this.accessMaskLbl.TabIndex = 3;
			this.accessMaskLbl.Text = "&Desired Access:";
			this.accessMaskLbl.TextAlign = System.Drawing.ContentAlignment.TopRight;
			// 
			// manualCheckButton
			// 
			this.manualCheckButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
			this.manualCheckButton.Enabled = false;
			this.manualCheckButton.Location = new System.Drawing.Point(120, 140);
			this.manualCheckButton.Name = "manualCheckButton";
			this.manualCheckButton.Size = new System.Drawing.Size(100, 23);
			this.manualCheckButton.TabIndex = 7;
			this.manualCheckButton.Text = "&Manual Check";
			this.manualCheckButton.Click += new System.EventHandler(this.manualCheckButton_Click);
			// 
			// statusBar2
			// 
			this.statusBar2.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
            this.statusLabelb1});
			this.statusBar2.LayoutStyle = System.Windows.Forms.ToolStripLayoutStyle.Table;
			this.statusBar2.Location = new System.Drawing.Point(0, 166);
			this.statusBar2.Name = "statusBar2";
			this.statusBar2.Size = new System.Drawing.Size(342, 22);
			this.statusBar2.TabIndex = 9;
			this.statusBar2.Text = "Ready";
			// 
			// statusLabelb1
			// 
			this.statusLabelb1.Name = "statusLabelb1";
			this.statusLabelb1.Text = "Ready";
			// 
			// AccCheckFrm
			// 
			this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
			this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
			this.ClientSize = new System.Drawing.Size(342, 188);
			this.Controls.Add(this.manualCheckButton);
			this.Controls.Add(this.accessMaskLbl);
			this.Controls.Add(this.accessMaskEdit);
			this.Controls.Add(this.actionDescLbl);
			this.Controls.Add(this.regKeyLbl);
			this.Controls.Add(this.regKeyEdit);
			this.Controls.Add(this.descriptiveLbl);
			this.Controls.Add(this.exitButton);
			this.Controls.Add(this.AccessCheckButton);
			this.Controls.Add(this.statusBar2);
			this.MinimumSize = new System.Drawing.Size(350, 215);
			this.Name = "AccCheckFrm";
			this.Text = "Access Checks .NET";
			this.statusBar2.ResumeLayout(false);
			this.ResumeLayout(false);
			this.PerformLayout();

		}

		#endregion

		private System.Windows.Forms.Button AccessCheckButton;
		private System.Windows.Forms.Button exitButton;
		private System.Windows.Forms.Label descriptiveLbl;
		private System.Windows.Forms.TextBox regKeyEdit;
		private System.Windows.Forms.Label regKeyLbl;
		private System.Windows.Forms.Label actionDescLbl;
		private System.Windows.Forms.TextBox accessMaskEdit;
		private System.Windows.Forms.Label accessMaskLbl;
		private System.Windows.Forms.Button manualCheckButton;
		private System.Windows.Forms.StatusStrip statusBar2;
		private System.Windows.Forms.ToolStripStatusLabel statusLabelb1;
	}
}

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


Written By
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 | :) .

Comments and Discussions