Rights management System of WinForm development framework

Source: Internet
Author: User
Tags rar

Reproduced in this article: http://www.cnblogs.com/wuhuacong/archive/2011/05/08/2040620.html

At this point, the Rights Management module introduction has been completed, the following gives a call example demo program to everyone reference learning, as follows:

Http://files.cnblogs.com/wuhuacong/SecurityDemo.rar

Dictionary Component Module Invocation example of the previous file The demo program is also available for download as follows:

Http://files.cnblogs.com/wuhuacong/DictionaryDemo.rar

Comments on the 40 floor:

However, you can first post the code in the core control section of the permission:/// <summary> ///To set permissions on a component on a form/// </summary> /// <param name= "form" >the form in which the control resides</param> /// <param name= "Getpermissionshandler" >gets the key value pair of the component name and its Enabled property (current user) in the form</param>  Public Static voidSetPermissions ( ThisForm form, Func<form, idictionary<string,BOOL>>Getpermissionshandler) {Type T=form.     GetType (); Fieldinfo[] FS= T.getfields (BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.Instance |bindingflags.static); IDictionary<string,BOOL> Permissions =Getpermissionshandler (form); foreach(FieldInfo FinchFS) {Dynamic Component=f.getvalue (form); if(Component isSystem.ComponentModel.Component &&permissions. ContainsKey (F.name)) {Try{component. Enabled=Permissions[f.name]; }             Catch { }         }     } } 

Rights management System of WinForm development framework

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.