Initial rebranded upload

This commit is contained in:
Patrick Smits
2017-11-21 17:01:13 +01:00
parent c4288e785c
commit a8a9ca103c
25 changed files with 9164 additions and 0 deletions

720
Permissions/Form1.Designer.cs generated Normal file
View File

@@ -0,0 +1,720 @@
namespace Permissions
{
partial class Form1
{
/// <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()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Form1));
this.getPermissions_bttn = new System.Windows.Forms.Button();
this.Folder_textbox = new System.Windows.Forms.TextBox();
this.richTextBox1 = new System.Windows.Forms.RichTextBox();
this.recusive_chkBox = new System.Windows.Forms.CheckBox();
this.clear_bttn = new System.Windows.Forms.Button();
this.label1 = new System.Windows.Forms.Label();
this.getPermissionsRecursive = new System.ComponentModel.BackgroundWorker();
this.label2 = new System.Windows.Forms.Label();
this.results_textbox = new System.Windows.Forms.TextBox();
this.cancel_bttn = new System.Windows.Forms.Button();
this.saveFD = new System.Windows.Forms.SaveFileDialog();
this.result_panel = new System.Windows.Forms.Panel();
this.mainProgressBar = new System.Windows.Forms.ProgressBar();
this.loading_pic = new System.Windows.Forms.PictureBox();
this.label5 = new System.Windows.Forms.Label();
this.label4 = new System.Windows.Forms.Label();
this.saveAs_bttn = new System.Windows.Forms.Button();
this.label3 = new System.Windows.Forms.Label();
this.endTime_label = new System.Windows.Forms.Label();
this.startTime_label = new System.Windows.Forms.Label();
this.dataGridView1 = new System.Windows.Forms.DataGridView();
this.PathColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.GroupColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.UserColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.version_lbl = new System.Windows.Forms.Label();
this.options_link = new System.Windows.Forms.LinkLabel();
this.options_panel = new System.Windows.Forms.Panel();
this.getOwnerGroup_chkBox = new System.Windows.Forms.CheckBox();
this.onlyLeesGebr_chkBox = new System.Windows.Forms.CheckBox();
this.exclude_bttn = new System.Windows.Forms.Button();
this.skipDoubleGroup_chkBox = new System.Windows.Forms.CheckBox();
this.ignorePassGroups_chkBox = new System.Windows.Forms.CheckBox();
this.saveAs = new System.ComponentModel.BackgroundWorker();
this.multiPath_bttn = new System.Windows.Forms.Button();
this.tabControl1 = new System.Windows.Forms.TabControl();
this.SharePermissions = new System.Windows.Forms.TabPage();
this.maxLvl_numud = new System.Windows.Forms.NumericUpDown();
this.label7 = new System.Windows.Forms.Label();
this.path_panel = new System.Windows.Forms.Panel();
this.DEV_logo = new System.Windows.Forms.PictureBox();
this.homeDir = new System.Windows.Forms.TabPage();
this.label6 = new System.Windows.Forms.Label();
this.usr_group_browse_bttn = new System.Windows.Forms.Button();
this.user_group_textbox = new System.Windows.Forms.TextBox();
this.debug_panel = new System.Windows.Forms.Panel();
this.memUsage_lbl = new System.Windows.Forms.Label();
this.label8 = new System.Windows.Forms.Label();
this.pauseDebug_bttn = new System.Windows.Forms.Button();
this.saveDebug_bttn = new System.Windows.Forms.Button();
this.viewCSV_bttn = new System.Windows.Forms.Button();
this.debug_rtextbox = new System.Windows.Forms.RichTextBox();
this.upDateDebugLog = new System.ComponentModel.BackgroundWorker();
this.result_panel.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.loading_pic)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).BeginInit();
this.options_panel.SuspendLayout();
this.tabControl1.SuspendLayout();
this.SharePermissions.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.maxLvl_numud)).BeginInit();
this.path_panel.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.DEV_logo)).BeginInit();
this.homeDir.SuspendLayout();
this.debug_panel.SuspendLayout();
this.SuspendLayout();
//
// getPermissions_bttn
//
this.getPermissions_bttn.Location = new System.Drawing.Point(6, 29);
this.getPermissions_bttn.Name = "getPermissions_bttn";
this.getPermissions_bttn.Size = new System.Drawing.Size(105, 23);
this.getPermissions_bttn.TabIndex = 0;
this.getPermissions_bttn.Text = "Scan permissions";
this.getPermissions_bttn.UseVisualStyleBackColor = true;
this.getPermissions_bttn.Click += new System.EventHandler(this.getPermissions_bttn_Click);
//
// Folder_textbox
//
this.Folder_textbox.BackColor = System.Drawing.Color.White;
this.Folder_textbox.BorderStyle = System.Windows.Forms.BorderStyle.None;
this.Folder_textbox.Location = new System.Drawing.Point(3, 1);
this.Folder_textbox.Name = "Folder_textbox";
this.Folder_textbox.Size = new System.Drawing.Size(370, 13);
this.Folder_textbox.TabIndex = 1;
this.Folder_textbox.Text = "folder_textbox";
this.Folder_textbox.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.Folder_textbox_KeyPress);
//
// richTextBox1
//
this.richTextBox1.BackColor = System.Drawing.SystemColors.Window;
this.richTextBox1.DetectUrls = false;
this.richTextBox1.Location = new System.Drawing.Point(11, 34);
this.richTextBox1.Name = "richTextBox1";
this.richTextBox1.ReadOnly = true;
this.richTextBox1.Size = new System.Drawing.Size(1287, 577);
this.richTextBox1.TabIndex = 2;
this.richTextBox1.Text = "";
//
// recusive_chkBox
//
this.recusive_chkBox.AutoSize = true;
this.recusive_chkBox.Location = new System.Drawing.Point(117, 34);
this.recusive_chkBox.Name = "recusive_chkBox";
this.recusive_chkBox.Size = new System.Drawing.Size(74, 17);
this.recusive_chkBox.TabIndex = 3;
this.recusive_chkBox.Text = "Recursive";
this.recusive_chkBox.UseVisualStyleBackColor = true;
this.recusive_chkBox.CheckedChanged += new System.EventHandler(this.recusive_chkBox_CheckedChanged);
//
// clear_bttn
//
this.clear_bttn.Location = new System.Drawing.Point(11, 3);
this.clear_bttn.Name = "clear_bttn";
this.clear_bttn.Size = new System.Drawing.Size(89, 23);
this.clear_bttn.TabIndex = 4;
this.clear_bttn.Text = "Clear results";
this.clear_bttn.UseVisualStyleBackColor = true;
this.clear_bttn.Click += new System.EventHandler(this.clear_bttn_Click);
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(6, 7);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(32, 13);
this.label1.TabIndex = 5;
this.label1.Text = "Path:";
//
// getPermissionsRecursive
//
this.getPermissionsRecursive.WorkerSupportsCancellation = true;
this.getPermissionsRecursive.DoWork += new System.ComponentModel.DoWorkEventHandler(this.getPermissionsRecursive_DoWork);
this.getPermissionsRecursive.RunWorkerCompleted += new System.ComponentModel.RunWorkerCompletedEventHandler(this.getPermissionsRecursive_RunWorkerCompleted);
//
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(1147, 11);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(45, 13);
this.label2.TabIndex = 10;
this.label2.Text = "Results:";
//
// results_textbox
//
this.results_textbox.Location = new System.Drawing.Point(1192, 8);
this.results_textbox.Name = "results_textbox";
this.results_textbox.ReadOnly = true;
this.results_textbox.Size = new System.Drawing.Size(100, 20);
this.results_textbox.TabIndex = 11;
//
// cancel_bttn
//
this.cancel_bttn.Location = new System.Drawing.Point(19, 29);
this.cancel_bttn.Name = "cancel_bttn";
this.cancel_bttn.Size = new System.Drawing.Size(76, 23);
this.cancel_bttn.TabIndex = 12;
this.cancel_bttn.Text = "Cancel";
this.cancel_bttn.UseVisualStyleBackColor = true;
this.cancel_bttn.Visible = false;
this.cancel_bttn.Click += new System.EventHandler(this.cancel_bttn_Click);
//
// saveFD
//
this.saveFD.DefaultExt = "csv";
//
// result_panel
//
this.result_panel.Controls.Add(this.mainProgressBar);
this.result_panel.Controls.Add(this.label2);
this.result_panel.Controls.Add(this.loading_pic);
this.result_panel.Controls.Add(this.label5);
this.result_panel.Controls.Add(this.label4);
this.result_panel.Controls.Add(this.saveAs_bttn);
this.result_panel.Controls.Add(this.label3);
this.result_panel.Controls.Add(this.clear_bttn);
this.result_panel.Controls.Add(this.results_textbox);
this.result_panel.Controls.Add(this.endTime_label);
this.result_panel.Controls.Add(this.startTime_label);
this.result_panel.Controls.Add(this.dataGridView1);
this.result_panel.Controls.Add(this.richTextBox1);
this.result_panel.Location = new System.Drawing.Point(3, 99);
this.result_panel.Name = "result_panel";
this.result_panel.Size = new System.Drawing.Size(1310, 621);
this.result_panel.TabIndex = 13;
//
// mainProgressBar
//
this.mainProgressBar.Location = new System.Drawing.Point(635, 8);
this.mainProgressBar.Name = "mainProgressBar";
this.mainProgressBar.Size = new System.Drawing.Size(220, 18);
this.mainProgressBar.TabIndex = 21;
this.mainProgressBar.Visible = false;
//
// loading_pic
//
this.loading_pic.Location = new System.Drawing.Point(208, 4);
this.loading_pic.Name = "loading_pic";
this.loading_pic.Size = new System.Drawing.Size(26, 26);
this.loading_pic.TabIndex = 20;
this.loading_pic.TabStop = false;
this.loading_pic.Visible = false;
//
// label5
//
this.label5.AutoSize = true;
this.label5.Location = new System.Drawing.Point(1045, 11);
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(51, 13);
this.label5.TabIndex = 19;
this.label5.Text = "End time:";
//
// label4
//
this.label4.AutoSize = true;
this.label4.Location = new System.Drawing.Point(938, 11);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(54, 13);
this.label4.TabIndex = 18;
this.label4.Text = "Start time:";
//
// saveAs_bttn
//
this.saveAs_bttn.Location = new System.Drawing.Point(104, 3);
this.saveAs_bttn.Name = "saveAs_bttn";
this.saveAs_bttn.Size = new System.Drawing.Size(98, 23);
this.saveAs_bttn.TabIndex = 15;
this.saveAs_bttn.Text = "Save as...";
this.saveAs_bttn.UseVisualStyleBackColor = true;
this.saveAs_bttn.Click += new System.EventHandler(this.saveAs_bttn_Click);
//
// label3
//
this.label3.Location = new System.Drawing.Point(237, 10);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(360, 16);
this.label3.TabIndex = 14;
this.label3.Text = "label3";
//
// endTime_label
//
this.endTime_label.AutoSize = true;
this.endTime_label.Location = new System.Drawing.Point(1094, 11);
this.endTime_label.Name = "endTime_label";
this.endTime_label.Size = new System.Drawing.Size(76, 13);
this.endTime_label.TabIndex = 17;
this.endTime_label.Text = "endTime_label";
//
// startTime_label
//
this.startTime_label.AutoSize = true;
this.startTime_label.Location = new System.Drawing.Point(990, 11);
this.startTime_label.Name = "startTime_label";
this.startTime_label.Size = new System.Drawing.Size(78, 13);
this.startTime_label.TabIndex = 16;
this.startTime_label.Text = "startTime_label";
//
// dataGridView1
//
this.dataGridView1.AllowUserToAddRows = false;
this.dataGridView1.AllowUserToDeleteRows = false;
this.dataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.dataGridView1.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
this.PathColumn,
this.GroupColumn,
this.UserColumn});
this.dataGridView1.Location = new System.Drawing.Point(9, 34);
this.dataGridView1.Name = "dataGridView1";
this.dataGridView1.ReadOnly = true;
this.dataGridView1.RowHeadersWidth = 8;
this.dataGridView1.Size = new System.Drawing.Size(1287, 577);
this.dataGridView1.TabIndex = 12;
//
// PathColumn
//
this.PathColumn.HeaderText = "Path";
this.PathColumn.Name = "PathColumn";
this.PathColumn.ReadOnly = true;
this.PathColumn.Width = 600;
//
// GroupColumn
//
this.GroupColumn.HeaderText = "Group";
this.GroupColumn.Name = "GroupColumn";
this.GroupColumn.ReadOnly = true;
this.GroupColumn.Width = 400;
//
// UserColumn
//
this.UserColumn.HeaderText = "Member";
this.UserColumn.Name = "UserColumn";
this.UserColumn.ReadOnly = true;
this.UserColumn.Width = 255;
//
// version_lbl
//
this.version_lbl.Font = new System.Drawing.Font("Microsoft Sans Serif", 7F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.version_lbl.Location = new System.Drawing.Point(187, 3);
this.version_lbl.Name = "version_lbl";
this.version_lbl.RightToLeft = System.Windows.Forms.RightToLeft.Yes;
this.version_lbl.Size = new System.Drawing.Size(127, 19);
this.version_lbl.TabIndex = 6;
this.version_lbl.Text = "v999.999.999.999";
//
// options_link
//
this.options_link.AutoSize = true;
this.options_link.Location = new System.Drawing.Point(6, 53);
this.options_link.Name = "options_link";
this.options_link.Size = new System.Drawing.Size(161, 13);
this.options_link.TabIndex = 14;
this.options_link.TabStop = true;
this.options_link.Text = "-------------- Show options --------------";
this.options_link.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.options_link_LinkClicked);
//
// options_panel
//
this.options_panel.Controls.Add(this.getOwnerGroup_chkBox);
this.options_panel.Controls.Add(this.onlyLeesGebr_chkBox);
this.options_panel.Controls.Add(this.exclude_bttn);
this.options_panel.Controls.Add(this.skipDoubleGroup_chkBox);
this.options_panel.Controls.Add(this.ignorePassGroups_chkBox);
this.options_panel.Location = new System.Drawing.Point(4, 66);
this.options_panel.Name = "options_panel";
this.options_panel.Size = new System.Drawing.Size(1309, 28);
this.options_panel.TabIndex = 15;
this.options_panel.Visible = false;
//
// getOwnerGroup_chkBox
//
this.getOwnerGroup_chkBox.AutoSize = true;
this.getOwnerGroup_chkBox.Location = new System.Drawing.Point(354, 7);
this.getOwnerGroup_chkBox.Name = "getOwnerGroup_chkBox";
this.getOwnerGroup_chkBox.Size = new System.Drawing.Size(153, 17);
this.getOwnerGroup_chkBox.TabIndex = 4;
this.getOwnerGroup_chkBox.Text = "Get __eign group members";
this.getOwnerGroup_chkBox.UseVisualStyleBackColor = true;
this.getOwnerGroup_chkBox.Visible = false;
//
// onlyLeesGebr_chkBox
//
this.onlyLeesGebr_chkBox.AutoSize = true;
this.onlyLeesGebr_chkBox.Location = new System.Drawing.Point(128, 7);
this.onlyLeesGebr_chkBox.Name = "onlyLeesGebr_chkBox";
this.onlyLeesGebr_chkBox.Size = new System.Drawing.Size(218, 17);
this.onlyLeesGebr_chkBox.TabIndex = 3;
this.onlyLeesGebr_chkBox.Text = "Only groups ending with __lees && __gebr";
this.onlyLeesGebr_chkBox.UseVisualStyleBackColor = true;
this.onlyLeesGebr_chkBox.Visible = false;
//
// exclude_bttn
//
this.exclude_bttn.Location = new System.Drawing.Point(875, 3);
this.exclude_bttn.Name = "exclude_bttn";
this.exclude_bttn.Size = new System.Drawing.Size(91, 23);
this.exclude_bttn.TabIndex = 2;
this.exclude_bttn.Text = "Exclude folders";
this.exclude_bttn.UseVisualStyleBackColor = true;
this.exclude_bttn.Visible = false;
//
// skipDoubleGroup_chkBox
//
this.skipDoubleGroup_chkBox.AutoSize = true;
this.skipDoubleGroup_chkBox.Checked = true;
this.skipDoubleGroup_chkBox.CheckState = System.Windows.Forms.CheckState.Checked;
this.skipDoubleGroup_chkBox.Location = new System.Drawing.Point(4, 7);
this.skipDoubleGroup_chkBox.Name = "skipDoubleGroup_chkBox";
this.skipDoubleGroup_chkBox.Size = new System.Drawing.Size(117, 17);
this.skipDoubleGroup_chkBox.TabIndex = 1;
this.skipDoubleGroup_chkBox.Text = "Skip double groups";
this.skipDoubleGroup_chkBox.UseVisualStyleBackColor = true;
//
// ignorePassGroups_chkBox
//
this.ignorePassGroups_chkBox.AutoSize = true;
this.ignorePassGroups_chkBox.Location = new System.Drawing.Point(508, 7);
this.ignorePassGroups_chkBox.Name = "ignorePassGroups_chkBox";
this.ignorePassGroups_chkBox.Size = new System.Drawing.Size(117, 17);
this.ignorePassGroups_chkBox.TabIndex = 0;
this.ignorePassGroups_chkBox.Text = "Ignore Pass groups";
this.ignorePassGroups_chkBox.UseVisualStyleBackColor = true;
this.ignorePassGroups_chkBox.Visible = false;
//
// saveAs
//
this.saveAs.DoWork += new System.ComponentModel.DoWorkEventHandler(this.saveAs_DoWork);
this.saveAs.RunWorkerCompleted += new System.ComponentModel.RunWorkerCompletedEventHandler(this.saveAs_RunWorkerCompleted);
//
// multiPath_bttn
//
this.multiPath_bttn.Location = new System.Drawing.Point(427, 2);
this.multiPath_bttn.Name = "multiPath_bttn";
this.multiPath_bttn.Size = new System.Drawing.Size(66, 23);
this.multiPath_bttn.TabIndex = 16;
this.multiPath_bttn.Text = "Browse";
this.multiPath_bttn.UseVisualStyleBackColor = true;
this.multiPath_bttn.Click += new System.EventHandler(this.multiPath_bttn_Click);
//
// tabControl1
//
this.tabControl1.Controls.Add(this.SharePermissions);
this.tabControl1.Controls.Add(this.homeDir);
this.tabControl1.Location = new System.Drawing.Point(1, 2);
this.tabControl1.Name = "tabControl1";
this.tabControl1.SelectedIndex = 0;
this.tabControl1.Size = new System.Drawing.Size(1321, 747);
this.tabControl1.TabIndex = 21;
this.tabControl1.SelectedIndexChanged += new System.EventHandler(this.tabControl1_SelectedIndexChanged);
//
// SharePermissions
//
this.SharePermissions.Controls.Add(this.maxLvl_numud);
this.SharePermissions.Controls.Add(this.label7);
this.SharePermissions.Controls.Add(this.path_panel);
this.SharePermissions.Controls.Add(this.DEV_logo);
this.SharePermissions.Controls.Add(this.multiPath_bttn);
this.SharePermissions.Controls.Add(this.options_panel);
this.SharePermissions.Controls.Add(this.result_panel);
this.SharePermissions.Controls.Add(this.options_link);
this.SharePermissions.Controls.Add(this.label1);
this.SharePermissions.Controls.Add(this.recusive_chkBox);
this.SharePermissions.Controls.Add(this.cancel_bttn);
this.SharePermissions.Controls.Add(this.getPermissions_bttn);
this.SharePermissions.Location = new System.Drawing.Point(4, 22);
this.SharePermissions.Name = "SharePermissions";
this.SharePermissions.Padding = new System.Windows.Forms.Padding(3);
this.SharePermissions.Size = new System.Drawing.Size(1313, 721);
this.SharePermissions.TabIndex = 0;
this.SharePermissions.Text = "Share Permissions";
this.SharePermissions.UseVisualStyleBackColor = true;
//
// maxLvl_numud
//
this.maxLvl_numud.Location = new System.Drawing.Point(207, 33);
this.maxLvl_numud.Maximum = new decimal(new int[] {
4,
0,
0,
0});
this.maxLvl_numud.Minimum = new decimal(new int[] {
1,
0,
0,
0});
this.maxLvl_numud.Name = "maxLvl_numud";
this.maxLvl_numud.Size = new System.Drawing.Size(30, 20);
this.maxLvl_numud.TabIndex = 19;
this.maxLvl_numud.Value = new decimal(new int[] {
1,
0,
0,
0});
this.maxLvl_numud.Visible = false;
//
// label7
//
this.label7.AutoSize = true;
this.label7.Location = new System.Drawing.Point(241, 35);
this.label7.Name = "label7";
this.label7.Size = new System.Drawing.Size(63, 13);
this.label7.TabIndex = 5;
this.label7.Text = "Levels max.";
this.label7.Visible = false;
//
// path_panel
//
this.path_panel.BackColor = System.Drawing.SystemColors.Window;
this.path_panel.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
this.path_panel.Controls.Add(this.Folder_textbox);
this.path_panel.Location = new System.Drawing.Point(39, 5);
this.path_panel.Name = "path_panel";
this.path_panel.Size = new System.Drawing.Size(380, 19);
this.path_panel.TabIndex = 18;
//
// DEV_logo
//
this.DEV_logo.Image = global::Permissions.Properties.Resources.logo;
this.DEV_logo.InitialImage = global::Permissions.Properties.Resources.logo;
this.DEV_logo.Location = new System.Drawing.Point(1153, 0);
this.DEV_logo.Name = "DEV_logo";
this.DEV_logo.Size = new System.Drawing.Size(142, 66);
this.DEV_logo.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
this.DEV_logo.TabIndex = 7;
this.DEV_logo.TabStop = false;
//
// homeDir
//
this.homeDir.Controls.Add(this.label6);
this.homeDir.Controls.Add(this.usr_group_browse_bttn);
this.homeDir.Controls.Add(this.user_group_textbox);
this.homeDir.Location = new System.Drawing.Point(4, 22);
this.homeDir.Name = "homeDir";
this.homeDir.Padding = new System.Windows.Forms.Padding(3);
this.homeDir.Size = new System.Drawing.Size(1313, 721);
this.homeDir.TabIndex = 1;
this.homeDir.Text = "Homedirectory";
this.homeDir.UseVisualStyleBackColor = true;
//
// label6
//
this.label6.AutoSize = true;
this.label6.Location = new System.Drawing.Point(22, 14);
this.label6.Name = "label6";
this.label6.Size = new System.Drawing.Size(76, 13);
this.label6.TabIndex = 2;
this.label6.Text = "User or Group:";
//
// usr_group_browse_bttn
//
this.usr_group_browse_bttn.Location = new System.Drawing.Point(347, 9);
this.usr_group_browse_bttn.Name = "usr_group_browse_bttn";
this.usr_group_browse_bttn.Size = new System.Drawing.Size(24, 23);
this.usr_group_browse_bttn.TabIndex = 1;
this.usr_group_browse_bttn.Text = "...";
this.usr_group_browse_bttn.UseVisualStyleBackColor = true;
//
// user_group_textbox
//
this.user_group_textbox.Location = new System.Drawing.Point(101, 11);
this.user_group_textbox.Name = "user_group_textbox";
this.user_group_textbox.Size = new System.Drawing.Size(240, 20);
this.user_group_textbox.TabIndex = 0;
//
// debug_panel
//
this.debug_panel.Controls.Add(this.memUsage_lbl);
this.debug_panel.Controls.Add(this.label8);
this.debug_panel.Controls.Add(this.pauseDebug_bttn);
this.debug_panel.Controls.Add(this.saveDebug_bttn);
this.debug_panel.Controls.Add(this.viewCSV_bttn);
this.debug_panel.Controls.Add(this.version_lbl);
this.debug_panel.Controls.Add(this.debug_rtextbox);
this.debug_panel.Location = new System.Drawing.Point(1328, 2);
this.debug_panel.Name = "debug_panel";
this.debug_panel.Size = new System.Drawing.Size(320, 741);
this.debug_panel.TabIndex = 22;
this.debug_panel.Visible = false;
//
// memUsage_lbl
//
this.memUsage_lbl.AutoSize = true;
this.memUsage_lbl.Location = new System.Drawing.Point(97, 695);
this.memUsage_lbl.Name = "memUsage_lbl";
this.memUsage_lbl.Size = new System.Drawing.Size(44, 13);
this.memUsage_lbl.TabIndex = 5;
this.memUsage_lbl.Text = "000 MB";
//
// label8
//
this.label8.AutoSize = true;
this.label8.Location = new System.Drawing.Point(3, 695);
this.label8.Name = "label8";
this.label8.Size = new System.Drawing.Size(79, 13);
this.label8.TabIndex = 4;
this.label8.Text = "Memory usage:";
//
// pauseDebug_bttn
//
this.pauseDebug_bttn.Location = new System.Drawing.Point(120, 669);
this.pauseDebug_bttn.Name = "pauseDebug_bttn";
this.pauseDebug_bttn.Size = new System.Drawing.Size(105, 23);
this.pauseDebug_bttn.TabIndex = 3;
this.pauseDebug_bttn.Text = "Pause debugger";
this.pauseDebug_bttn.UseVisualStyleBackColor = true;
this.pauseDebug_bttn.Click += new System.EventHandler(this.pauseDebug_bttn_Click);
//
// saveDebug_bttn
//
this.saveDebug_bttn.Location = new System.Drawing.Point(3, 669);
this.saveDebug_bttn.Name = "saveDebug_bttn";
this.saveDebug_bttn.Size = new System.Drawing.Size(111, 23);
this.saveDebug_bttn.TabIndex = 2;
this.saveDebug_bttn.Text = "Save debug log";
this.saveDebug_bttn.UseVisualStyleBackColor = true;
//
// viewCSV_bttn
//
this.viewCSV_bttn.Location = new System.Drawing.Point(3, 3);
this.viewCSV_bttn.Name = "viewCSV_bttn";
this.viewCSV_bttn.Size = new System.Drawing.Size(111, 23);
this.viewCSV_bttn.TabIndex = 1;
this.viewCSV_bttn.Text = "View CSV";
this.viewCSV_bttn.UseVisualStyleBackColor = true;
this.viewCSV_bttn.Click += new System.EventHandler(this.viewCSV_bttn_Click);
//
// debug_rtextbox
//
this.debug_rtextbox.Location = new System.Drawing.Point(3, 32);
this.debug_rtextbox.Name = "debug_rtextbox";
this.debug_rtextbox.Size = new System.Drawing.Size(314, 631);
this.debug_rtextbox.TabIndex = 0;
this.debug_rtextbox.Text = "";
this.debug_rtextbox.WordWrap = false;
//
// upDateDebugLog
//
this.upDateDebugLog.WorkerSupportsCancellation = true;
this.upDateDebugLog.DoWork += new System.ComponentModel.DoWorkEventHandler(this.updateDebugLog_DoWork);
//
// Form1
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(1648, 747);
this.Controls.Add(this.debug_panel);
this.Controls.Add(this.tabControl1);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.MaximizeBox = false;
this.Name = "Form1";
this.Text = "Share Permissions";
this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.Form1_KeyDown);
this.result_panel.ResumeLayout(false);
this.result_panel.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.loading_pic)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).EndInit();
this.options_panel.ResumeLayout(false);
this.options_panel.PerformLayout();
this.tabControl1.ResumeLayout(false);
this.SharePermissions.ResumeLayout(false);
this.SharePermissions.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.maxLvl_numud)).EndInit();
this.path_panel.ResumeLayout(false);
this.path_panel.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.DEV_logo)).EndInit();
this.homeDir.ResumeLayout(false);
this.homeDir.PerformLayout();
this.debug_panel.ResumeLayout(false);
this.debug_panel.PerformLayout();
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.Button getPermissions_bttn;
private System.Windows.Forms.TextBox Folder_textbox;
private System.Windows.Forms.RichTextBox richTextBox1;
private System.Windows.Forms.CheckBox recusive_chkBox;
private System.Windows.Forms.Button clear_bttn;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.PictureBox DEV_logo;
private System.ComponentModel.BackgroundWorker getPermissionsRecursive;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.TextBox results_textbox;
private System.Windows.Forms.Button cancel_bttn;
private System.Windows.Forms.SaveFileDialog saveFD;
private System.Windows.Forms.Panel result_panel;
private System.Windows.Forms.LinkLabel options_link;
private System.Windows.Forms.Panel options_panel;
private System.Windows.Forms.CheckBox ignorePassGroups_chkBox;
private System.Windows.Forms.DataGridView dataGridView1;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.Button saveAs_bttn;
private System.Windows.Forms.Label endTime_label;
private System.Windows.Forms.Label startTime_label;
private System.Windows.Forms.Label label5;
private System.Windows.Forms.Label label4;
private System.Windows.Forms.CheckBox skipDoubleGroup_chkBox;
private System.Windows.Forms.PictureBox loading_pic;
private System.ComponentModel.BackgroundWorker saveAs;
private System.Windows.Forms.DataGridViewTextBoxColumn PathColumn;
private System.Windows.Forms.DataGridViewTextBoxColumn GroupColumn;
private System.Windows.Forms.DataGridViewTextBoxColumn UserColumn;
private System.Windows.Forms.Button multiPath_bttn;
private System.Windows.Forms.Button exclude_bttn;
private System.Windows.Forms.TabControl tabControl1;
private System.Windows.Forms.TabPage SharePermissions;
private System.Windows.Forms.TabPage homeDir;
private System.Windows.Forms.Label label6;
private System.Windows.Forms.Button usr_group_browse_bttn;
private System.Windows.Forms.TextBox user_group_textbox;
private System.Windows.Forms.CheckBox onlyLeesGebr_chkBox;
private System.Windows.Forms.Panel path_panel;
private System.Windows.Forms.Panel debug_panel;
private System.Windows.Forms.RichTextBox debug_rtextbox;
private System.Windows.Forms.Button viewCSV_bttn;
private System.Windows.Forms.Button saveDebug_bttn;
private System.ComponentModel.BackgroundWorker upDateDebugLog;
private System.Windows.Forms.ProgressBar mainProgressBar;
private System.Windows.Forms.Button pauseDebug_bttn;
private System.Windows.Forms.Label label7;
private System.Windows.Forms.CheckBox getOwnerGroup_chkBox;
private System.Windows.Forms.Label memUsage_lbl;
private System.Windows.Forms.Label label8;
private System.Windows.Forms.NumericUpDown maxLvl_numud;
private System.Windows.Forms.Label version_lbl;
}
}

941
Permissions/Form1.cs Normal file
View File

@@ -0,0 +1,941 @@
using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.IO;
using System.Security.AccessControl;
using System.Text.RegularExpressions;
using System.DirectoryServices;
using System.Threading;
using System.Diagnostics;
using System.Globalization;
using System.Deployment;
using System.Reflection;
using Excel = Microsoft.Office.Interop.Excel;
namespace Permissions
{
public partial class Form1 : Form
{
// CONFIGURATION
int optionsToggleMove = 28;
int debugPanelMove = 333;
string LDAPDirEnt = "LDAP://DC=domain,DC=local"; // TODO: Obsolete?
string getUserInfo = "sAMAccountName"; // TODO: Make configurable through UI
string ignoreGroupNameBegin = "BUILTIN,LOCAL,NT AUTHORITY,SYSTEM,S-"; // TODO: Make configurable through UI
public static string startFolder = @""; // TODO: Obsolete, remove all references
int maxDirDepth = 5;
// END CONFIGURATION
string groupNameStripBegin = Environment.UserDomainName + @"\";
string permInfo = "";
int resultCount = 0;
Dictionary<string, string> groupHist = new Dictionary<string,string>();
ArrayList groupNames = new ArrayList();
Dictionary<string, string> groupsAndMembers = new Dictionary<string, string>();
public static ArrayList folderList = new ArrayList();
public static ArrayList folderListTemp = new ArrayList();
public static ArrayList debugInfo = new ArrayList();
// GUI
public Form1()
{
InitializeComponent();
string currentVersion = Application.ProductVersion.ToString();
version_lbl.Text = "v" + currentVersion;
updateDebugInfo("Function InitializeComponent() called");
this.KeyPreview = true;
this.Height = this.Height - optionsToggleMove;
result_panel.Location = new Point(result_panel.Location.X, result_panel.Location.Y - optionsToggleMove);
this.Width = this.Width - debugPanelMove;
label3.Text = "";
saveAs_bttn.Enabled = false;
clear_bttn.Enabled = false;
startTime_label.Text = "";
endTime_label.Text = "";
Folder_textbox.Text = "";
results_textbox.Text = resultCount.ToString();
tabControl1.TabPages.Remove(homeDir);
updateDebugInfo("Program started");
updateDebugInfo("Version: " + currentVersion);
}
public void UnhandledThreadExceptionHandler(object sender, ThreadExceptionEventArgs e)
{
this.HandleUnhandledException(e.Exception);
}
public void HandleUnhandledException(Exception e, bool ShowMessageBox = false)
{
// do what you want here.
updateDebugInfo("---------------------------");
updateDebugInfo("Unhandeled exeption:");
updateDebugInfo(e.Message);
updateDebugInfo("---------------------------");
if (ShowMessageBox == true)
{
if (MessageBox.Show("An unexpected error has occurred. Continue?",
"My application", MessageBoxButtons.YesNo, MessageBoxIcon.Stop,
MessageBoxDefaultButton.Button2) == DialogResult.No)
{
Application.Exit();
}
}
}
private void controlsEnabled(bool enabled)
{
updateDebugInfo("Function controlsEnabled(bool " + enabled + ") called");
saveAs_bttn.Enabled = enabled;
clear_bttn.Enabled = enabled;
getPermissions_bttn.Enabled = enabled;
getPermissions_bttn.Visible = enabled;
skipDoubleGroup_chkBox.Enabled = enabled;
ignorePassGroups_chkBox.Enabled = enabled;
onlyLeesGebr_chkBox.Enabled = enabled;
recusive_chkBox.Enabled = enabled;
getOwnerGroup_chkBox.Enabled = enabled;
multiPath_bttn.Enabled = enabled;
maxLvl_numud.Enabled = enabled;
if (folderListTemp.Count < 2)
{
path_panel.Enabled = enabled;
}
}
public void startScan()
{
updateDebugInfo("Function startScan() called");
updateDebugInfo("Scan options:");
updateDebugInfo("Recursive: " + recusive_chkBox.Checked);
updateDebugInfo("Recursive levels: " + maxLvl_numud.Value);
updateDebugInfo("Ignore __pass groups: " + ignorePassGroups_chkBox.Checked);
updateDebugInfo("Skip double groups: " + skipDoubleGroup_chkBox.Checked);
updateDebugInfo("Only __lees && __gebr groups: " + onlyLeesGebr_chkBox.Checked);
updateDebugInfo("Get __eign group members: " + getOwnerGroup_chkBox.Checked);
if (upDateDebugLog.IsBusy) { upDateDebugLog.CancelAsync(); pauseDebug_bttn.Text = "Scan running"; pauseDebug_bttn.Enabled = false; updateDebugInfo("Pausing debug background worker to prevent conflicts between worker threads"); };
loading_pic_visible(true);
cancel_bttn.Visible = true;
cancel_bttn.Enabled = true;
folderListTemp.Clear();
controlsEnabled(false);
mainProgressBar.Visible = true;
startTime_label.Text = DateTime.Now.Hour.ToString() + ":" + DateTime.Now.Minute.ToString() + ":" + DateTime.Now.Second.ToString();
}
public void endScan()
{
updateDebugInfo("Function endScan() called");
loading_pic_visible(false);
cancel_bttn.Visible = false;
cancel_bttn.Enabled = false;
mainProgressBar.Visible = false;
controlsEnabled(true);
groupHist.Clear();
label3.Text = "";
endTime_label.Text = DateTime.Now.Hour.ToString() + ":" + DateTime.Now.Minute.ToString() + ":" + DateTime.Now.Second.ToString();
if (pauseDebug_bttn.Enabled == false && pauseDebug_bttn.Text == "Scan running") { upDateDebugLog.RunWorkerAsync(); pauseDebug_bttn.Text = "Pause debugger"; pauseDebug_bttn.Enabled = true; };
}
private void updateResults(int resultCount)
{
results_textbox.Text = resultCount.ToString();
}
public delegate void updateResultsCallback(int resultCount);
private void updateRichTextBox1(string txt)
{
richTextBox1.Text = txt;
}
public delegate void updateRichTextBox1Callback(string txt);
private void updateDebug_rtextbox(string txt)
{
if (txt != debug_rtextbox.Text)
{
debug_rtextbox.Text = txt;
}
}
public delegate void updateDebug_rtextboxCallback(string txt);
private void updateDataGridView1(string dataGridInfo)
{
string[] dataGridInfo2 = dataGridInfo.Split('|');
dataGridView1.Rows.Add(dataGridInfo2[0], dataGridInfo2[1], dataGridInfo2[2]);
}
public delegate void updateDataGridView1Callback(string dataGridInfo);
private void updateLabel3(string txt)
{
label3.Text = txt;
}
public delegate void updateLabel3Callback(string text);
private void loading_pic_visible(bool visible)
{
loading_pic.Visible = visible;
}
public delegate void loading_pic_visibleCallback(bool visible);
private void mainProgressBar_update(int Current, bool visible)
{
mainProgressBar.Value = Current;
mainProgressBar.Visible = visible;
}
public delegate void mainProgressBar_updateCallback(int Current, bool visible);
private void mainProgressBar_setMax(int Max)
{
mainProgressBar.Maximum = Max;
}
public delegate void mainProgressBar_setMaxCallback(int Max);
private void updateMemUsage_lbl(string txt)
{
memUsage_lbl.Text = txt;
}
public delegate void updateMemUsage_lblCallback(string text);
public void toggleDebugPanelVisible()
{
if (debug_panel.Visible == false)
{
this.Width = this.Width + debugPanelMove;
debug_panel.Visible = true;
updateDebugInfo("Debug panel opened");
upDateDebugLog.RunWorkerAsync();
updateDebugInfo("Debug background worker started");
tabControl1.TabPages.Add(homeDir);
}
else if (debug_panel.Visible == true)
{
this.Width = this.Width - debugPanelMove;
debug_panel.Visible = false;
updateDebugInfo("Debug panel closed");
if (upDateDebugLog.IsBusy) { upDateDebugLog.CancelAsync(); };
updateDebugInfo("Debug background worker stopped");
tabControl1.TabPages.Remove(homeDir);
}
}
public void toggleCSVvisible()
{
if (dataGridView1.Visible == true) { dataGridView1.Visible = false; }
else { dataGridView1.Visible = true; }
}
// GUI controls
private void cancel_bttn_Click(object sender, EventArgs e)
{
updateDebugInfo("cancel_bttn was clicked");
label3.Text = "Cancelling...";
if (getPermissionsRecursive.IsBusy) { getPermissionsRecursive.CancelAsync(); };
cancel_bttn.Enabled = false;
}
private void options_link_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
{
updateDebugInfo("options_Link was clicked");
if (options_panel.Visible)
{
updateDebugInfo("Disabling options panel");
options_panel.Visible = false;
options_link.Text = "-------------- Show options --------------";
//this.Height = this.Height - optionsToggleMove;
result_panel.Height = result_panel.Height + optionsToggleMove;
dataGridView1.Height = dataGridView1.Height + optionsToggleMove;
richTextBox1.Height = richTextBox1.Height + optionsToggleMove;
result_panel.Location = new Point(result_panel.Location.X, result_panel.Location.Y - optionsToggleMove);
}
else
{
updateDebugInfo("Enabling options panel");
options_panel.Visible = true;
options_link.Text = "-------------- Hide options ---------------";
//this.Height = this.Height + optionsToggleMove;
result_panel.Height = result_panel.Height - optionsToggleMove;
dataGridView1.Height = dataGridView1.Height - optionsToggleMove;
richTextBox1.Height = richTextBox1.Height - optionsToggleMove;
result_panel.Location = new Point(result_panel.Location.X, result_panel.Location.Y + optionsToggleMove);
};
}
private void saveAs_bttn_Click(object sender, EventArgs e)
{
updateDebugInfo("saveAs_bttn was clicked");
if (results_textbox.Text != "0" && results_textbox.Text != "")
{
string savedFile = "";
saveFD.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.Desktop);
saveFD.Title = "Save as...";
saveFD.FileName = "permissions";
saveFD.Filter = "Excel Files|*.xls|CSV Files|*.csv|TXT Files|*.txt";
if (saveFD.ShowDialog() != DialogResult.Cancel)
{
savedFile = saveFD.FileName;
controlsEnabled(false);
label3.Invoke(new updateLabel3Callback(this.updateLabel3), new object[] { "Saving file..." });
loading_pic.Invoke(new loading_pic_visibleCallback(this.loading_pic_visible), new object[] { true });
if (File.Exists(savedFile)) { File.Delete(savedFile); }
//TODO: Make full use of the background worker for saving to file
if (savedFile.EndsWith(".xls"))
{
updateDebugInfo("Saving file als .xls in " + savedFile);
saveAs.RunWorkerAsync(savedFile);
}
else if (Path.GetExtension(savedFile).ToLower() == ".csv" || Path.GetExtension(savedFile).ToLower() == ".txt")
{
updateDebugInfo("Saving file als .csv in " + savedFile);
saveCSV(savedFile);
}
else
{
MessageBox.Show("Unsupported file format...");
updateDebugInfo("Unsupported file format...");
}
}
}
else { MessageBox.Show("No results"); updateDebugInfo("No results"); }
}
private void getPermissions_bttn_Click(object sender, EventArgs e)
{
updateDebugInfo("getPermissions_bttn was clicked");
scanPermissions();
}
private void Folder_textbox_KeyPress(object sender, KeyPressEventArgs e)
{
if (e.KeyChar == (char)13)
{
scanPermissions();
}
}
private void clear_bttn_Click(object sender, EventArgs e)
{
updateDebugInfo("clear_bttn was clicked");
richTextBox1.Text = "";
permInfo = "";
resultCount = 0;
results_textbox.Text = resultCount.ToString();
dataGridView1.Rows.Clear();
groupHist.Clear();
groupsAndMembers.Clear();
startTime_label.Text = "";
endTime_label.Text = "";
saveAs_bttn.Enabled = false;
clear_bttn.Enabled = false;
updateDebugInfo("All results cleared");
}
private void multiPath_bttn_Click(object sender, EventArgs e)
{
updateDebugInfo("multiPath_bttn was clicked");
multiPath multiPathForm = new multiPath();
controlsEnabled(false);
if(multiPathForm.ShowDialog() == DialogResult.OK)
{
controlsEnabled(true);
}
else
{
controlsEnabled(true);
}
updateDebugInfo("The multipath dialogue was used");
if (folderList.Count > 0)
{
path_panel.Enabled = false;
Folder_textbox.Text = "[Multiple Folders]";
updateDebugInfo("Multipath folder count = " + folderList.Count + "");
if (folderList.Count == 1)
{
path_panel.Enabled = true;
Folder_textbox.Text = folderList[0].ToString().Replace(startFolder, "");
updateDebugInfo("Found only 1 value in multipath array");
}
}
else
{
path_panel.Enabled = true;
Folder_textbox.Text = "";
updateDebugInfo("The multipath dialogue was cancelled");
}
}
private void Form1_KeyDown(object sender, KeyEventArgs e)
{
if (e.Control && e.KeyCode == Keys.D)
{
updateDebugInfo("CTRL + D was pressed");
toggleDebugPanelVisible();
}
}
private void viewCSV_bttn_Click(object sender, EventArgs e)
{
toggleCSVvisible();
}
private void pauseDebug_bttn_Click(object sender, EventArgs e)
{
if (upDateDebugLog.IsBusy) { upDateDebugLog.CancelAsync(); pauseDebug_bttn.Text = "Resume debugger"; updateDebugInfo("Debug background worker stopped"); };
if (!upDateDebugLog.IsBusy) { pauseDebug_bttn.Text = "Pause debugger"; upDateDebugLog.RunWorkerAsync(); updateDebugInfo("Debug background worker started"); };
}
private void tabControl1_SelectedIndexChanged(object sender, EventArgs e)
{
updateDebugInfo("Selected TAB changed to: "+tabControl1.SelectedTab.ToString());
}
private void recusive_chkBox_CheckedChanged(object sender, EventArgs e)
{
if (recusive_chkBox.Checked)
{
maxLvl_numud.Visible = true;
label7.Visible = true;
}
else
{
maxLvl_numud.Visible = false;
label7.Visible = false;
}
}
// Functions
private void scanPermissions()
{
updateDebugInfo("Function scanPermissions() called");
updateDebugInfo("Folder_textbox.text = " + Folder_textbox.Text + "");
if (folderList.Count == 0)
{
updateDebugInfo("folderList count = 0");
folderList.Add(Folder_textbox.Text);
updateDebugInfo("folderList add " + Folder_textbox.Text + "");
}
bool dirExists = true;
foreach (string f in folderList)
{
if (!Directory.Exists(f))
{
dirExists = false;
}
}
if (dirExists)
{
updateDebugInfo("Folders in folderList exist");
startScan();
updateDebugInfo("Scanning folders:");
foreach (string f in folderList)
{
folderListTemp.Add(f);
updateDebugInfo(" " + f + "");
}
getPermissionsRecursive.RunWorkerAsync(folderListTemp);
}
else
{
MessageBox.Show("Path incorrect");
updateDebugInfo("Path incorrect!");
if (Folder_textbox.Enabled)
{
updateDebugInfo("Cleared folderList");
folderList.Clear();
}
}
}
public bool ignoreGroupNamesBegin(string ignoreGroups, string ignoredGroupNameBegin)
{
updateDebugInfo("Function ignoreGroupNamesBegin(string " + ignoreGroups + ", string " + ignoredGroupNameBegin + ") called");
string[] ignoredGroups = ignoreGroups.Split(',');
bool result = false;
if (!result)
{
foreach (string ignoregroup in ignoredGroups)
{
if (!result)
{
if (ignoredGroupNameBegin.StartsWith(ignoregroup))
{
result = true;
}
}
}
}
return result;
}
public ArrayList splitGroupMembers(Dictionary<string, string> GroupsAndMembers, string groupName)
{
ArrayList splitGroupMembers = new ArrayList();
if (GroupsAndMembers.ContainsKey(groupName))
{
string[] s = GroupsAndMembers[groupName].Split('|');
foreach (string gm in s)
{
if (gm != "")
{ splitGroupMembers.Add(gm); }
}
}
return splitGroupMembers;
}
public Dictionary<string, string> GetGroupMembers(string strGroup)
{
string groupMembers = "";
updateDebugInfo("Getting group members for " + strGroup);
if (!groupsAndMembers.ContainsKey(strGroup))
{
updateDebugInfo("Group was not in cache, doing LDAP queries");
try
{
DirectoryEntry ent = new DirectoryEntry(LDAPDirEnt);
DirectorySearcher srch = new DirectorySearcher("(CN=" + strGroup + ")");
SearchResultCollection coll = srch.FindAll();
foreach (SearchResult rs in coll)
{
ResultPropertyCollection resultPropColl = rs.Properties;
foreach (Object memberColl in resultPropColl["member"])
{
DirectoryEntry gpMemberEntry = new DirectoryEntry("LDAP://" + memberColl);
System.DirectoryServices.PropertyCollection userProps = gpMemberEntry.Properties;
object obVal = userProps[getUserInfo].Value;
if (null != obVal)
{
groupMembers = groupMembers + "|" + obVal.ToString();
}
}
}
if (groupMembers != "")
{
groupsAndMembers.Add(strGroup, groupMembers);
}
}
catch (Exception ex)
{
HandleUnhandledException(ex);
}
}
return groupsAndMembers;
}
public static string StringCollectionToString(StringCollection stringCollection)
{
string outputString = "";
if (stringCollection != null && stringCollection.Count > 0)
{
foreach (string inputString in stringCollection)
outputString += inputString + ",";
outputString = outputString.Substring(0, outputString.Length - 1);
}
return outputString;
}
public ArrayList DirSearch(string sDir)
{
ArrayList directories = new ArrayList();
updateDebugInfo("Function DirSearch(string " + sDir + ") was called");
directories.Add(sDir);
foreach (string d in Directory.GetDirectories(sDir))
{
if (getPermissionsRecursive.CancellationPending) { break; };
string[] dirCount = sDir.Split('\\');
directories.Add(d);
if (dirCount.Length < maxDirDepth)
{
foreach (string f in Directory.GetDirectories(d))
{
if (getPermissionsRecursive.CancellationPending) { break; };
directories.Add(f);
}
DirSearch(d);
}
}
return directories;
}
private void releaseObject(object obj)
{
try
{
System.Runtime.InteropServices.Marshal.ReleaseComObject(obj);
obj = null;
}
catch (Exception ex)
{
obj = null;
HandleUnhandledException(ex);
}
finally
{
GC.Collect();
}
}
private void saveXLS(string savedFile)
{
CultureInfo oldCI = Thread.CurrentThread.CurrentCulture;
Thread.CurrentThread.CurrentCulture = new CultureInfo("en-US");
Excel.Application xlApp;
Excel.Workbook xlWorkBook;
Excel.Worksheet xlWorkSheet;
object misValue = System.Reflection.Missing.Value;
xlApp = new Excel.ApplicationClass();
xlWorkBook = xlApp.Workbooks.Add(misValue);
xlWorkSheet = (Excel.Worksheet)xlWorkBook.Worksheets.get_Item(1);
int i = 0;
int j = 0;
for (i = 0; i <= dataGridView1.RowCount - 1; i++)
{
for (j = 0; j <= dataGridView1.ColumnCount - 1; j++)
{
DataGridViewCell cell = dataGridView1[j, i];
xlWorkSheet.Cells[i + 1, j + 1] = cell.Value;
}
}
xlWorkBook.SaveAs(savedFile, Excel.XlFileFormat.xlWorkbookNormal, misValue, misValue, misValue, misValue, Excel.XlSaveAsAccessMode.xlExclusive, misValue, misValue, misValue, misValue, misValue);
xlWorkBook.Close(true, misValue, misValue);
xlApp.Quit();
releaseObject(xlWorkSheet);
releaseObject(xlWorkBook);
releaseObject(xlApp);
MessageBox.Show("File saved as: " + savedFile);
updateDebugInfo("File saved as: " + savedFile);
if (oldCI != null)
{ Thread.CurrentThread.CurrentCulture = oldCI; }
}
private void saveCSV(string savedFile)
{
richTextBox1.SaveFile(savedFile, RichTextBoxStreamType.PlainText);
MessageBox.Show("File saved as: " + savedFile);
updateDebugInfo("File saved as: " + savedFile);
label3.Invoke(new updateLabel3Callback(this.updateLabel3), new object[] { "" });
loading_pic.Invoke(new loading_pic_visibleCallback(this.loading_pic_visible), new object[] { false });
controlsEnabled(true);
}
public string currentTimeString()
{
string currentTimeString = DateTime.Now.Hour.ToString() + ":" + DateTime.Now.Minute.ToString() + ":" + DateTime.Now.Second.ToString();
return currentTimeString;
}
public void updateDebugInfo(string info)
{
try { debugInfo.Add(currentTimeString() + "|" + info); }
catch (Exception eDebugInfoAdd) { HandleUnhandledException(eDebugInfoAdd); };
}
// Background workers
private void getPermissionsRecursive_DoWork(object sender, DoWorkEventArgs e)
{
int maxDirDept_plus = 0;
if (Int32.TryParse(maxLvl_numud.Value.ToString(), out maxDirDept_plus) && recusive_chkBox.Checked)
{ maxDirDept_plus = Int32.Parse(maxLvl_numud.Value.ToString()); }
else
{ maxDirDept_plus = 1; }
maxDirDepth = maxDirDepth + maxDirDept_plus;
updateDebugInfo("Max dir depth set to:" + maxDirDepth);
updateDebugInfo("Background worker getPermissionsRecurisve started");
ArrayList subPath = new ArrayList();
foreach (string f in folderListTemp)
{
if (recusive_chkBox.Checked)
{
label3.Invoke(new updateLabel3Callback(this.updateLabel3), new object[] { "Scanning for folders(" + f + ")..." });
updateDebugInfo("Scanning folders...");
foreach (string subPath2 in DirSearch(f))
{
if (getPermissionsRecursive.CancellationPending)
{
e.Cancel = true;
label3.Invoke(new updateLabel3Callback(this.updateLabel3), new object[] { "Cancelled..." });
Thread.Sleep(2);
break;
}
subPath.Add(subPath2);
}
}
else
{
subPath.Add(f);
}
}
subPath.Sort();
int currentProgress = 0;
updateDebugInfo("Found " + subPath.Count + " Folders to check ACL");
foreach (string subDir in subPath)
{
currentProgress = currentProgress + 1;
mainProgressBar.Invoke(new mainProgressBar_setMaxCallback(this.mainProgressBar_setMax), new object[] { subPath.Count });
mainProgressBar.Invoke(new mainProgressBar_updateCallback(this.mainProgressBar_update), new object[] { currentProgress, true });
if (getPermissionsRecursive.CancellationPending)
{
e.Cancel = true;
break;
}
label3.Invoke(new updateLabel3Callback(this.updateLabel3), new object[] { "Scanning ACL (" + subDir + ")..." });
updateDebugInfo("Scanning ACL (" + subDir + ")...");
// Load directory information
DirectorySecurity myDirectorySecurity = Directory.GetAccessControl(subDir);
// Obtain the access control list (ACL)
AuthorizationRuleCollection ACL = myDirectorySecurity.GetAccessRules(true, false, typeof(System.Security.Principal.NTAccount));
// Go thru each access control entry (ACE) in the ACL
foreach (AuthorizationRule ACE in ACL)
{
System.Threading.Thread.Sleep(50);
if (getPermissionsRecursive.CancellationPending)
{
e.Cancel = true;
label3.Invoke(new updateLabel3Callback(this.updateLabel3), new object[] { "Cancelled..." });
updateDebugInfo("Cancelled backgroundworker");
Thread.Sleep(2);
break;
}
string groupName = ACE.IdentityReference.ToString();
groupName = groupName.Replace(groupNameStripBegin, "");
if (getOwnerGroup_chkBox.Checked)
{
if (groupName.Contains("__gebr") || groupName.Contains("__lees"))
{
string groupNameOwner = "";
groupNameOwner = groupName.Replace("__gebr", "__eign");
groupNameOwner = groupName.Replace("__lees", "__eign");
if (!groupHist.ContainsKey(groupNameOwner) || !groupHist.ContainsValue(subDir))
{
if (skipDoubleGroup_chkBox.Checked)
{ groupHist[groupNameOwner] = subDir; }
if (!ignoreGroupNamesBegin(ignoreGroupNameBegin, groupNameOwner))
{
bool getMembers = true;
if (groupNameOwner.StartsWith(ignoreGroupNameBegin)) { getMembers = false; }
if (getMembers)
{
label3.Invoke(new updateLabel3Callback(this.updateLabel3), new object[] { "Getting members for " + groupNameOwner + "..." });
Dictionary<string, string> groupMembers = GetGroupMembers(groupNameOwner);
ArrayList membersOfGroup = splitGroupMembers(groupMembers, groupNameOwner);
foreach (string gm in membersOfGroup)
{
string dataGridInfo = subDir + "|" + groupNameOwner + "|" + gm;
permInfo = permInfo + subDir + "," + groupNameOwner + "," + gm + "\n";
dataGridView1.Invoke(new updateDataGridView1Callback(this.updateDataGridView1), new object[] { dataGridInfo });
richTextBox1.Invoke(new updateRichTextBox1Callback(this.updateRichTextBox1), new object[] { permInfo });
resultCount = dataGridView1.RowCount;
results_textbox.Invoke(new updateResultsCallback(this.updateResults), new object[] { resultCount });
}
}
}
}
}
}
if (!groupHist.ContainsKey(groupName) || !groupHist.ContainsValue(subDir))
{
if (skipDoubleGroup_chkBox.Checked)
{ groupHist[groupName] = subDir; }
if (!ignoreGroupNamesBegin(ignoreGroupNameBegin, groupName))
{
bool getMembers = true;
if (ignorePassGroups_chkBox.Checked && groupName.EndsWith("__pass")) { getMembers = false; }
else if (onlyLeesGebr_chkBox.Checked && groupName.EndsWith("__gebr") == false && groupName.EndsWith("__lees") == false) { getMembers = false; }
else if (groupName.StartsWith(ignoreGroupNameBegin)) { getMembers = false; }
if (getMembers)
{
label3.Invoke(new updateLabel3Callback(this.updateLabel3), new object[] { "Getting members for " + groupName + "..." });
Dictionary<string, string> groupMembers = GetGroupMembers(groupName);
ArrayList membersOfGroup = splitGroupMembers(groupMembers, groupName);
foreach (string gm in membersOfGroup)
{
string dataGridInfo = subDir + "|" + groupName + "|" + gm;
permInfo = permInfo + subDir + "," + groupName + "," + gm + "\n";
dataGridView1.Invoke(new updateDataGridView1Callback(this.updateDataGridView1), new object[] { dataGridInfo });
richTextBox1.Invoke(new updateRichTextBox1Callback(this.updateRichTextBox1), new object[] { permInfo });
resultCount = dataGridView1.RowCount;
results_textbox.Invoke(new updateResultsCallback(this.updateResults), new object[] { resultCount });
}
}
}
}
}
}
e.Result = permInfo;
}
private void getPermissionsRecursive_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
{
endScan();
updateDebugInfo("Background worker getPermissionsRecurisve stopped");
mainProgressBar.Invoke(new mainProgressBar_setMaxCallback(this.mainProgressBar_setMax), new object[] { 0 });
mainProgressBar.Invoke(new mainProgressBar_updateCallback(this.mainProgressBar_update), new object[] { 0, false });
}
private void saveAs_DoWork(object sender, DoWorkEventArgs e)
{
updateDebugInfo("Background worker saveAs started");
string savedFile = (string)e.Argument;
if (savedFile.EndsWith(".xls"))
{
updateDebugInfo("Saving as .xls file");
saveXLS(savedFile);
}
else if (Path.GetExtension(savedFile).ToLower() == ".csv" || Path.GetExtension(savedFile).ToLower() == ".txt")
{
updateDebugInfo("Saving as .csv or .txt file");
saveCSV(savedFile);
}
else
{
MessageBox.Show("Unsupported file format...");
updateDebugInfo("Unsupported file format...");
}
}
private void saveAs_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
{
label3.Invoke(new updateLabel3Callback(this.updateLabel3), new object[] { "" });
loading_pic.Invoke(new loading_pic_visibleCallback(this.loading_pic_visible), new object[] { false });
controlsEnabled(true);
updateDebugInfo("Background worker saveAs stopped");
}
private void updateDebugLog_DoWork(object sender, DoWorkEventArgs e)
{
updateDebugInfo("Starting debug background worker");
while (true)
{
string debugInfoTemp = "";
try
{
foreach (string d in debugInfo)
{
debugInfoTemp = debugInfoTemp + d + "\n";
}
}
catch (Exception ex)
{ HandleUnhandledException(ex); }
PerformanceCounter performanceCounter = new PerformanceCounter();
performanceCounter.CategoryName = "Process";
performanceCounter.CounterName = "Working Set";
performanceCounter.InstanceName = Process.GetCurrentProcess().ProcessName;
memUsage_lbl.Invoke(new updateMemUsage_lblCallback(this.updateMemUsage_lbl), new object[] { ((uint)performanceCounter.NextValue() / 1024).ToString("N0") + " MB" });
Thread.Sleep(500);
if (upDateDebugLog.CancellationPending)
{
e.Cancel = true;
updateDebugInfo("Cancelling debug background worker");
break;
}
try { debug_rtextbox.Invoke(new updateDebug_rtextboxCallback(this.updateDebug_rtextbox), new object[] { debugInfoTemp }); }
catch (Exception eUpdateDebugInfo) { HandleUnhandledException(eUpdateDebugInfo); };
}
updateDebugInfo("Stopping debug background worker");
}
}
}

6317
Permissions/Form1.resx Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,179 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>9.0.30729</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{E7BE4322-832C-4C78-AD4F-E06F2A267CAA}</ProjectGuid>
<OutputType>WinExe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Permissions</RootNamespace>
<AssemblyName>SharePermissions</AssemblyName>
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<ManifestCertificateThumbprint>F310EB7CA93BF5E37B87521DB1AAD8394E53E9D1</ManifestCertificateThumbprint>
<ManifestKeyFile>Permissions_TemporaryKey.pfx</ManifestKeyFile>
<GenerateManifests>true</GenerateManifests>
<SignManifests>false</SignManifests>
<IsWebBootstrapper>false</IsWebBootstrapper>
<FileUpgradeFlags>
</FileUpgradeFlags>
<UpgradeBackupLocation>
</UpgradeBackupLocation>
<OldToolsVersion>3.5</OldToolsVersion>
<PublishUrl>publish\</PublishUrl>
<Install>true</Install>
<InstallFrom>Disk</InstallFrom>
<UpdateEnabled>false</UpdateEnabled>
<UpdateMode>Foreground</UpdateMode>
<UpdateInterval>7</UpdateInterval>
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
<UpdatePeriodically>false</UpdatePeriodically>
<UpdateRequired>false</UpdateRequired>
<MapFileExtensions>false</MapFileExtensions>
<ApplicationRevision>27</ApplicationRevision>
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
<UseApplicationTrust>false</UseApplicationTrust>
<PublishWizardCompleted>true</PublishWizardCompleted>
<BootstrapperEnabled>true</BootstrapperEnabled>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="Microsoft.Office.Interop.Excel, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" />
<Reference Include="System" />
<Reference Include="System.Core">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
<Reference Include="System.DirectoryServices" />
<Reference Include="System.Xml.Linq">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
<Reference Include="System.Data.DataSetExtensions">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
<Reference Include="System.Data" />
<Reference Include="System.Deployment" />
<Reference Include="System.Drawing" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Form1.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Form1.Designer.cs">
<DependentUpon>Form1.cs</DependentUpon>
</Compile>
<Compile Include="multiPath.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="multiPath.Designer.cs">
<DependentUpon>multiPath.cs</DependentUpon>
</Compile>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<EmbeddedResource Include="Form1.resx">
<DependentUpon>Form1.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="multiPath.resx">
<DependentUpon>multiPath.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
<SubType>Designer</SubType>
</EmbeddedResource>
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Resources.resx</DependentUpon>
<DesignTime>True</DesignTime>
</Compile>
<None Include="Permissions_TemporaryKey.pfx" />
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
<Compile Include="Properties\Settings.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
</ItemGroup>
<ItemGroup>
<BootstrapperPackage Include="Microsoft.Net.Framework.2.0">
<Visible>False</Visible>
<ProductName>.NET Framework 2.0 %28x86%29</ProductName>
<Install>false</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Net.Framework.3.0">
<Visible>False</Visible>
<ProductName>.NET Framework 3.0 %28x86%29</ProductName>
<Install>false</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5</ProductName>
<Install>true</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5 SP1</ProductName>
<Install>false</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Windows.Installer.3.1">
<Visible>False</Visible>
<ProductName>Windows Installer 3.1</ProductName>
<Install>true</Install>
</BootstrapperPackage>
</ItemGroup>
<ItemGroup>
<COMReference Include="VBIDE">
<Guid>{0002E157-0000-0000-C000-000000000046}</Guid>
<VersionMajor>5</VersionMajor>
<VersionMinor>3</VersionMinor>
<Lcid>0</Lcid>
<WrapperTool>primary</WrapperTool>
<Isolated>False</Isolated>
</COMReference>
</ItemGroup>
<ItemGroup>
<None Include="Resources\loading_transparent.gif" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\refresh.png" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\refresh28x28.png" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\refresh25x25.png" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\logo.png" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>

View File

@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="12.0">
<PropertyGroup>
<PublishUrlHistory>publish\</PublishUrlHistory>
<InstallUrlHistory>
</InstallUrlHistory>
<SupportUrlHistory>
</SupportUrlHistory>
<UpdateUrlHistory>
</UpdateUrlHistory>
<BootstrapperUrlHistory>
</BootstrapperUrlHistory>
<ErrorReportUrlHistory>
</ErrorReportUrlHistory>
<FallbackCulture>en-US</FallbackCulture>
<VerifyUploadedFiles>false</VerifyUploadedFiles>
</PropertyGroup>
</Project>

Binary file not shown.

25
Permissions/Program.cs Normal file
View File

@@ -0,0 +1,25 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;
using System.Threading;
namespace Permissions
{
static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Form1 form1 = new Form1();
Application.ThreadException += new ThreadExceptionEventHandler(form1.UnhandledThreadExceptionHandler);
Application.Run(form1);
}
}
}

View File

@@ -0,0 +1,36 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("AMCPermissions")]
[assembly: AssemblyDescription("Patrick Smits")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("AMC")]
[assembly: AssemblyProduct("AMCPermissions")]
[assembly: AssemblyCopyright("Copyright © 2013")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("7110a688-3c3e-4ea5-8b59-0c0edba22e0a")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

View File

@@ -0,0 +1,113 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace Permissions.Properties {
using System;
/// <summary>
/// A strongly-typed resource class, for looking up localized strings, etc.
/// </summary>
// This class was auto-generated by the StronglyTypedResourceBuilder
// class via a tool like ResGen or Visual Studio.
// To add or remove a member, edit your .ResX file then rerun ResGen
// with the /str option, or rebuild your VS project.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources {
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal Resources() {
}
/// <summary>
/// Returns the cached ResourceManager instance used by this class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager {
get {
if (object.ReferenceEquals(resourceMan, null)) {
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Permissions.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// Overrides the current thread's CurrentUICulture property for all
/// resource lookups using this strongly typed resource class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture {
get {
return resourceCulture;
}
set {
resourceCulture = value;
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap loading_transparent {
get {
object obj = ResourceManager.GetObject("loading_transparent", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap logo {
get {
object obj = ResourceManager.GetObject("logo", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap refresh {
get {
object obj = ResourceManager.GetObject("refresh", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap refresh25x25 {
get {
object obj = ResourceManager.GetObject("refresh25x25", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap refresh28x28 {
get {
object obj = ResourceManager.GetObject("refresh28x28", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
}
}

View File

@@ -0,0 +1,136 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="loading_transparent" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\loading_transparent.gif;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="refresh25x25" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\refresh25x25.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="refresh28x28" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\refresh28x28.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="refresh" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\refresh.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="logo" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\logo.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
</root>

View File

@@ -0,0 +1,26 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.34014
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace Permissions.Properties {
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "12.0.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
public static Settings Default {
get {
return defaultInstance;
}
}
}
}

View File

@@ -0,0 +1,7 @@
<?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)">
<Profiles>
<Profile Name="(Default)" />
</Profiles>
<Settings />
</SettingsFile>

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 647 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 565 B

256
Permissions/multiPath.Designer.cs generated Normal file
View File

@@ -0,0 +1,256 @@
namespace Permissions
{
partial class multiPath
{
/// <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.Error_label = new System.Windows.Forms.Label();
this.label1 = new System.Windows.Forms.Label();
this.ok_bttn = new System.Windows.Forms.Button();
this.cancel_bttn = new System.Windows.Forms.Button();
this.treeView1 = new System.Windows.Forms.TreeView();
this.folderScan = new System.ComponentModel.BackgroundWorker();
this.panel1 = new System.Windows.Forms.Panel();
this.loading_pnl = new System.Windows.Forms.Panel();
this.label2 = new System.Windows.Forms.Label();
this.label3 = new System.Windows.Forms.Label();
this.startFrom_textbox = new System.Windows.Forms.TextBox();
this.refresh_button = new System.Windows.Forms.Button();
this.pictureBox1 = new System.Windows.Forms.PictureBox();
this.startFrom_select = new System.Windows.Forms.ComboBox();
this.path_panel = new System.Windows.Forms.Panel();
this.panel1.SuspendLayout();
this.loading_pnl.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
this.path_panel.SuspendLayout();
this.SuspendLayout();
//
// Error_label
//
this.Error_label.AutoSize = true;
this.Error_label.ForeColor = System.Drawing.Color.DarkRed;
this.Error_label.Location = new System.Drawing.Point(97, 418);
this.Error_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.Error_label.Name = "Error_label";
this.Error_label.Size = new System.Drawing.Size(78, 17);
this.Error_label.TabIndex = 4;
this.Error_label.Text = "Error_label";
//
// label1
//
this.label1.AutoSize = true;
this.label1.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.label1.Location = new System.Drawing.Point(205, 5);
this.label1.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(126, 20);
this.label1.TabIndex = 5;
this.label1.Text = "Select folders";
//
// ok_bttn
//
this.ok_bttn.Location = new System.Drawing.Point(101, 438);
this.ok_bttn.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.ok_bttn.Name = "ok_bttn";
this.ok_bttn.Size = new System.Drawing.Size(212, 28);
this.ok_bttn.TabIndex = 6;
this.ok_bttn.Text = "OK";
this.ok_bttn.UseVisualStyleBackColor = true;
this.ok_bttn.Click += new System.EventHandler(this.ok_bttn_Click);
//
// cancel_bttn
//
this.cancel_bttn.Location = new System.Drawing.Point(321, 438);
this.cancel_bttn.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.cancel_bttn.Name = "cancel_bttn";
this.cancel_bttn.Size = new System.Drawing.Size(100, 28);
this.cancel_bttn.TabIndex = 7;
this.cancel_bttn.Text = "Cancel";
this.cancel_bttn.UseVisualStyleBackColor = true;
this.cancel_bttn.Click += new System.EventHandler(this.cancel_bttn_Click);
//
// treeView1
//
this.treeView1.CheckBoxes = true;
this.treeView1.Location = new System.Drawing.Point(3, 58);
this.treeView1.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.treeView1.Name = "treeView1";
this.treeView1.Size = new System.Drawing.Size(543, 356);
this.treeView1.TabIndex = 8;
this.treeView1.BeforeExpand += new System.Windows.Forms.TreeViewCancelEventHandler(this.treeView1_BeforeExpand);
//
// folderScan
//
this.folderScan.DoWork += new System.ComponentModel.DoWorkEventHandler(this.folderScan_DoWork);
this.folderScan.RunWorkerCompleted += new System.ComponentModel.RunWorkerCompletedEventHandler(this.folderScan_RunWorkerCompleted);
//
// panel1
//
this.panel1.Controls.Add(this.startFrom_select);
this.panel1.Controls.Add(this.label3);
this.panel1.Controls.Add(this.loading_pnl);
this.panel1.Controls.Add(this.cancel_bttn);
this.panel1.Controls.Add(this.treeView1);
this.panel1.Controls.Add(this.Error_label);
this.panel1.Controls.Add(this.label1);
this.panel1.Controls.Add(this.ok_bttn);
this.panel1.Controls.Add(this.path_panel);
this.panel1.Location = new System.Drawing.Point(16, 13);
this.panel1.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.panel1.Name = "panel1";
this.panel1.Size = new System.Drawing.Size(549, 476);
this.panel1.TabIndex = 9;
//
// loading_pnl
//
this.loading_pnl.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.loading_pnl.Controls.Add(this.label2);
this.loading_pnl.Controls.Add(this.pictureBox1);
this.loading_pnl.Location = new System.Drawing.Point(196, 211);
this.loading_pnl.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.loading_pnl.Name = "loading_pnl";
this.loading_pnl.Size = new System.Drawing.Size(151, 64);
this.loading_pnl.TabIndex = 9;
this.loading_pnl.Visible = false;
//
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(57, 23);
this.label2.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(72, 17);
this.label2.TabIndex = 1;
this.label2.Text = "Working...";
//
// label3
//
this.label3.AutoSize = true;
this.label3.Location = new System.Drawing.Point(14, 30);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(74, 17);
this.label3.TabIndex = 10;
this.label3.Text = "Start from:";
//
// startFrom_textbox
//
this.startFrom_textbox.Location = new System.Drawing.Point(3, 10);
this.startFrom_textbox.Name = "startFrom_textbox";
this.startFrom_textbox.Size = new System.Drawing.Size(254, 22);
this.startFrom_textbox.TabIndex = 11;
this.startFrom_textbox.Text = "\\\\server\\share";
//
// refresh_button
//
this.refresh_button.Image = global::Permissions.Properties.Resources.refresh25x25;
this.refresh_button.Location = new System.Drawing.Point(263, 7);
this.refresh_button.Margin = new System.Windows.Forms.Padding(0);
this.refresh_button.Name = "refresh_button";
this.refresh_button.Size = new System.Drawing.Size(28, 28);
this.refresh_button.TabIndex = 12;
this.refresh_button.UseVisualStyleBackColor = true;
this.refresh_button.Click += new System.EventHandler(this.refresh_button_Click);
//
// pictureBox1
//
this.pictureBox1.Image = global::Permissions.Properties.Resources.loading_transparent;
this.pictureBox1.InitialImage = global::Permissions.Properties.Resources.loading_transparent;
this.pictureBox1.Location = new System.Drawing.Point(31, 19);
this.pictureBox1.Margin = new System.Windows.Forms.Padding(4);
this.pictureBox1.Name = "pictureBox1";
this.pictureBox1.Size = new System.Drawing.Size(35, 33);
this.pictureBox1.TabIndex = 0;
this.pictureBox1.TabStop = false;
//
// startFrom_select
//
this.startFrom_select.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.startFrom_select.FormattingEnabled = true;
this.startFrom_select.ImeMode = System.Windows.Forms.ImeMode.NoControl;
this.startFrom_select.Items.AddRange(new object[] {
"This PC",
"Path:"});
this.startFrom_select.Location = new System.Drawing.Point(94, 27);
this.startFrom_select.Name = "startFrom_select";
this.startFrom_select.Size = new System.Drawing.Size(96, 24);
this.startFrom_select.TabIndex = 13;
this.startFrom_select.SelectedIndexChanged += new System.EventHandler(this.startFrom_select_SelectedIndexChanged);
//
// path_panel
//
this.path_panel.Controls.Add(this.startFrom_textbox);
this.path_panel.Controls.Add(this.refresh_button);
this.path_panel.Location = new System.Drawing.Point(195, 18);
this.path_panel.Name = "path_panel";
this.path_panel.Size = new System.Drawing.Size(326, 41);
this.path_panel.TabIndex = 14;
this.path_panel.Visible = false;
//
// multiPath
//
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(585, 495);
this.Controls.Add(this.panel1);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
this.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "multiPath";
this.ShowIcon = false;
this.ShowInTaskbar = false;
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.panel1.ResumeLayout(false);
this.panel1.PerformLayout();
this.loading_pnl.ResumeLayout(false);
this.loading_pnl.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
this.path_panel.ResumeLayout(false);
this.path_panel.PerformLayout();
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.Label Error_label;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Button ok_bttn;
private System.Windows.Forms.Button cancel_bttn;
private System.Windows.Forms.TreeView treeView1;
private System.ComponentModel.BackgroundWorker folderScan;
private System.Windows.Forms.Panel panel1;
private System.Windows.Forms.Panel loading_pnl;
private System.Windows.Forms.PictureBox pictureBox1;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Button refresh_button;
private System.Windows.Forms.TextBox startFrom_textbox;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.ComboBox startFrom_select;
private System.Windows.Forms.Panel path_panel;
}
}

242
Permissions/multiPath.cs Normal file
View File

@@ -0,0 +1,242 @@
using System;
using System.Collections;
using System.Collections.Specialized;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.IO;
using System.Windows.Forms;
namespace Permissions
{
public partial class multiPath : Form
{
ArrayList pathList = new ArrayList();
string basePath = @"";
Form1 main = new Form1();
public multiPath()
{
InitializeComponent();
Error_label.Visible = false;
startFrom_select.SelectedIndex = 0;
makeDocumentTree();
}
private void cancel_bttn_Click(object sender, EventArgs e)
{
this.DialogResult = DialogResult.Cancel;
}
private void ok_bttn_Click(object sender, EventArgs e)
{
foreach (string checkNode in CheckedNodes(treeView1.Nodes, "fullPath"))
{
pathList.Add(@"\\" + checkNode);
}
Form1.folderList.Clear();
foreach (string i in pathList)
{
Form1.folderList.Add(i);
}
this.DialogResult = DialogResult.OK;
}
public void makeDocumentTree()
{
var locationsSub = new List<string>();
foreach (string d in DirSearch(basePath, true))
{
locationsSub.Add(d);
}
foreach (string f in Form1.folderList)
{
locationsSub.Add(f);
}
PopulateTreeView(treeView1, locationsSub, '\\');
treeView1.Refresh();
}
public delegate void treeviewRefreshCallback();
public void treeviewRefresh()
{
treeView1.Refresh();
}
private void PopulateTreeView(TreeView treeView, IEnumerable<string> paths, char pathSeparator)
{
ArrayList test = new ArrayList();
TreeNode lastNode = null;
string subPathAgg;
foreach (string path in paths)
{
subPathAgg = string.Empty;
foreach (string subPath in path.Split(pathSeparator))
{
if (subPath != "")
{
subPathAgg += subPath + pathSeparator;
TreeNode[] nodes = treeView.Nodes.Find(subPathAgg, true);
if (nodes.Length == 0)
if (lastNode == null)
lastNode = treeView.Nodes.Add(subPathAgg, subPath);
else
lastNode = lastNode.Nodes.Add(subPathAgg, subPath);
else
lastNode = nodes[0];
}
}
}
}
public ArrayList DirSearch(string sDir)
{
ArrayList directories = new ArrayList();
main.updateDebugInfo("Function DirSearch(string " + sDir + ") was called");
directories.Add(sDir);
try
{
foreach (string d in Directory.GetDirectories(sDir))
{
string[] dirCount = sDir.Split('\\');
directories.Add(d);
}
}
catch { }
return directories;
}
public ArrayList DirSearch(string sDir, bool incSub)
{
if (incSub == true)
{
ArrayList directories = new ArrayList();
main.updateDebugInfo("Function DirSearch(string " + sDir + ", bool " + incSub + ") was called");
directories.Add(sDir);
try
{
foreach (string d in Directory.GetDirectories(sDir))
{
string[] dirCount = sDir.Split('\\');
directories.Add(d);
try
{
foreach (string d2 in Directory.GetDirectories(d))
{
directories.Add(d2);
}
}
catch //(InvalidCastException e)
{
//throw (e);
}
}
}
catch //( InvalidCastException e )
{
//throw (e);
}
return directories;
}
else
{
return DirSearch(sDir);
}
}
private void treeView1_BeforeExpand(object sender, TreeViewCancelEventArgs e)
{
panel1.Enabled = false;
loading_pnl.Visible = true;
folderScan.RunWorkerAsync(e.Node.FullPath.ToString());
}
private List<String> CheckedNodes(System.Windows.Forms.TreeNodeCollection theNodes, string result)
{
List<String> aResult = new List<String>();
if (theNodes != null)
{
foreach (TreeNode aNode in theNodes)
{
if (aNode.Checked)
{
if (result == "name")
{
aResult.Add(aNode.Text);
}
else if (result == "fullPath")
{
aResult.Add(aNode.FullPath);
}
}
aResult.AddRange(CheckedNodes(aNode.Nodes, result));
}
}
return aResult;
}
private void checkNodes(System.Windows.Forms.TreeNodeCollection theNodes, string result)
{
foreach (TreeNode node in theNodes)
{
if (Form1.folderList.Contains(@"\\" + node.FullPath.ToString()))
{
node.Checked = true;
}
}
}
private void folderScan_DoWork(object sender, DoWorkEventArgs e)
{
var locationsSub = new List<string>();
foreach (string d in DirSearch(@"\\" + e, true))
{
if (d.StartsWith(basePath)) { locationsSub.Add(d); };
}
PopulateTreeView(treeView1, locationsSub, '\\');
treeView1.Invoke(new treeviewRefreshCallback(this.treeviewRefresh));
}
private void folderScan_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
{
loading_pnl.Visible = false;
panel1.Enabled = true;
}
private void startFrom_select_SelectedIndexChanged(object sender, EventArgs e)
{
if (startFrom_select.SelectedIndex == 1) { path_panel.Visible = true; } else { path_panel.Visible = false; makeDocumentTree(); };
}
private void refresh_button_Click(object sender, EventArgs e)
{
basePath = startFrom_textbox.Text;
makeDocumentTree();
}
}
}

126
Permissions/multiPath.resx Normal file
View File

@@ -0,0 +1,126 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="folderScan.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<metadata name="startFrom_select.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
</root>