• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# Security.PermissionSet类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中System.Security.PermissionSet的典型用法代码示例。如果您正苦于以下问题:C# System.Security.PermissionSet类的具体用法?C# System.Security.PermissionSet怎么用?C# System.Security.PermissionSet使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



System.Security.PermissionSet类属于命名空间,在下文中一共展示了System.Security.PermissionSet类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: Load

        public static int Load([MarshalAs(UnmanagedType.LPWStr)]String inParam)
        {
            try
            {
                lock (_lock)
                {
                    _injectCount++;
                    if (_easyHookDomain == null)
                    {
                        System.Security.PermissionSet ps = new System.Security.PermissionSet(System.Security.Permissions.PermissionState.Unrestricted);
                        ps.AddPermission(new System.Security.Permissions.SecurityPermission(System.Security.Permissions.SecurityPermissionFlag.AllFlags));
                        // Evidence of null means use the current appdomain evidence
                        _easyHookDomain = AppDomain.CreateDomain("EasyHook", null, new AppDomainSetup()
                        {
                            ApplicationBase = Path.GetDirectoryName(typeof(Loader).Assembly.Location),
                            // ShadowCopyFiles = "true", // copies assemblies from ApplicationBase into cache, leaving originals unlocked and updatable
                        }, ps);
                    }
                }

                int result = -1;

                // Load the EasyHook assembly in the child AppDomain by using the proxy class
                Type proxyType = typeof(LoadEasyHookProxy);
                if (proxyType.Assembly != null)
                {
                    // This is where the currentDomain.AssemblyResolve that we setup within the static 
                    // constructor is required.
                    var proxy = (LoadEasyHookProxy)_easyHookDomain.CreateInstanceFrom(
                                    proxyType.Assembly.Location,
                                    proxyType.FullName).Unwrap();

                    // Loads EasyHook.dll into the AppDomain, which in turn loads the target assembly
                    result = proxy.Load(inParam);
                }

                //result = new LoadEasyHookProxy().Load(inParam);
                return result;
            }
            catch (Exception e)
            {
                System.Diagnostics.Debug.WriteLine("Exception occured within Loader.Load: " + e.ToString());
            }
            finally
            {
                lock (_lock)
                {
                    _injectCount--;
                }
            }

            // Failed
            return -1;
        }
开发者ID:ezhangle,项目名称:Easyhook,代码行数:54,代码来源:Loader.cs


示例2: LoadReport

 //public DateTime DateFrom
 //{
 //    get
 //    {
 //        if (dateFrom.Value == "")
 //            return DateTime.Today.Date.AddDays(-1);
 //        else
 //            return DateTime.Parse(dateFrom.Value);
 //    }
 //}
 //public DateTime DateTo
 //{
 //    get
 //    {
 //        if (dateTo.Value == "")
 //            return DateTime.Today.Date.AddDays(-1);
 //        else
 //            return DateTime.Parse(dateTo.Value);
 //    }
 //}
 private void LoadReport(string path, List<ViewLvConsumed> _Employee)
 {
     string _Header = context.Options.FirstOrDefault().CompanyName + " - Anual Leave Report";
     ReportViewer1.ProcessingMode = ProcessingMode.Local;
     ReportViewer1.LocalReport.ReportPath = Server.MapPath(path);
     System.Security.PermissionSet sec = new System.Security.PermissionSet(System.Security.Permissions.PermissionState.Unrestricted);
     ReportViewer1.LocalReport.SetBasePermissionsForSandboxAppDomain(sec);
     IEnumerable<ViewLvConsumed> ie;
     ie = _Employee.AsQueryable();
     ReportDataSource datasource1 = new ReportDataSource("DataSet1", ie);
     ReportViewer1.LocalReport.DataSources.Clear();
     ReportViewer1.LocalReport.DataSources.Add(datasource1);
     ReportParameter rp = new ReportParameter("Header", _Header, false);
     this.ReportViewer1.LocalReport.SetParameters(new ReportParameter[] { rp });
     ReportViewer1.LocalReport.Refresh();
 }
开发者ID:qq5013,项目名称:WMS-Fatima,代码行数:36,代码来源:YLvConsumed.aspx.cs


示例3: LoadReport

        private void LoadReport(List<EmpMonthlyProductivityEntity> empe, string PathString, string _dateFrom, string _dateTo)
        {
            string Header = "Monthly Productivity Sheet";
            this.ReportViewer1.LocalReport.DisplayName = "Monthly Productivity Sheet";
            this.ReportViewer1.ProcessingMode = ProcessingMode.Local;
            string Month =  Convert.ToDateTime(_dateFrom).Date.ToString("MMMM-yyyy");
            Month = "For the Month of " + Month;
            this.ReportViewer1.LocalReport.ReportPath = Server.MapPath(PathString);
            System.Security.PermissionSet sec = new System.Security.PermissionSet(System.Security.Permissions.PermissionState.Unrestricted);
            this.ReportViewer1.LocalReport.SetBasePermissionsForSandboxAppDomain(sec);
            IEnumerable<EmpMonthlyProductivityEntity> ie;
            ie = empe.AsQueryable();
            IEnumerable<EmpPhoto> companyImage;
            companyImage = companyimage.AsQueryable();

            ReportDataSource datasource1 = new ReportDataSource("DataSet2", companyImage);
            ReportDataSource datasource2 = new ReportDataSource("DataSet1", ie);

            this.ReportViewer1.LocalReport.DataSources.Clear();
               ReportViewer1.LocalReport.EnableExternalImages = true;
              this.ReportViewer1.LocalReport.DataSources.Add(datasource1);
               ReportViewer1.LocalReport.DataSources.Add(datasource2);
              ReportParameter rp = new ReportParameter("Date", Month, false);
               ReportParameter rp1 = new ReportParameter("Header", Header, false);
               this.ReportViewer1.LocalReport.SetParameters(new ReportParameter[] { rp1, rp });
            this.ReportViewer1.LocalReport.Refresh();

            //this.ReportViewer1.LocalReport.DisplayName = title;
            //ReportViewer1.ProcessingMode = ProcessingMode.Local;
            //ReportViewer1.LocalReport.ReportPath = Server.MapPath(PathString);
            //System.Security.PermissionSet sec = new System.Security.PermissionSet(System.Security.Permissions.PermissionState.Unrestricted);
            //ReportViewer1.LocalReport.SetBasePermissionsForSandboxAppDomain(sec);
            //IEnumerable<DailySummary> ie;
            //ie = list.AsQueryable();
            //IEnumerable<EmpPhoto> companyImage;
            //companyImage = companyimage.AsQueryable();
            //ReportDataSource datasource1 = new ReportDataSource("DataSet1", ie);
            //ReportDataSource datasource2 = new ReportDataSource("DataSet2", companyImage);
            //ReportViewer1.LocalReport.DataSources.Clear();
            //ReportViewer1.LocalReport.EnableExternalImages = true;
            //ReportViewer1.LocalReport.DataSources.Add(datasource1);
            //ReportViewer1.LocalReport.DataSources.Add(datasource2);
            //ReportParameter rp = new ReportParameter("Date", p, false);
            //ReportParameter rp1 = new ReportParameter("Header", Header, false);
            //this.ReportViewer1.LocalReport.SetParameters(new ReportParameter[] { rp1, rp });
            //ReportViewer1.LocalReport.Refresh();
        }
开发者ID:linkstatic12,项目名称:WMS-Fatima,代码行数:47,代码来源:ReportContainer.aspx.cs


示例4: GetErasFromRegistry

        [System.Security.SecuritySafeCritical]  // auto-generated
        private static EraInfo[] GetErasFromRegistry()
        {
            // Look in the registry key and see if we can find any ranges
            int iFoundEras = 0;
            EraInfo[] registryEraRanges = null;
#if !MONO            
            try
            {
                // Need to access registry
                PermissionSet permSet = new PermissionSet(PermissionState.None);
                permSet.AddPermission(new RegistryPermission(RegistryPermissionAccess.Read, c_japaneseErasHivePermissionList));
                permSet.Assert();
                RegistryKey key = RegistryKey.GetBaseKey(RegistryKey.HKEY_LOCAL_MACHINE).OpenSubKey(c_japaneseErasHive, false);

                // Abort if we didn't find anything
                if (key == null) return null;

                // Look up the values in our reg key
                String[] valueNames = key.GetValueNames();
                if (valueNames != null && valueNames.Length > 0)
                {
                    registryEraRanges = new EraInfo[valueNames.Length];

                    // Loop through the registry and read in all the values
                    for (int i = 0; i < valueNames.Length; i++)
                    {
                        // See if the era is a valid date
                        EraInfo era = GetEraFromValue(valueNames[i], key.GetValue(valueNames[i]).ToString());

                        // continue if not valid
                        if (era == null) continue;

                        // Remember we found one.
                        registryEraRanges[iFoundEras] = era;
                        iFoundEras++;                        
                    }
                }
            }
            catch (System.Security.SecurityException)
            {
                // If we weren't allowed to read, then just ignore the error
                return null;
            }
            catch (System.IO.IOException)
            {
                // If key is being deleted just ignore the error
                return null;
            }
            catch (System.UnauthorizedAccessException)
            {
                // Registry access rights permissions, just ignore the error
                return null;
            }

            //
            // If we didn't have valid eras, then fail
            // should have at least 4 eras
            //
            if (iFoundEras < 4) return null;

            //
            // Now we have eras, clean them up.
            //
            // Clean up array length
            Array.Resize(ref registryEraRanges, iFoundEras);

            // Sort them
            Array.Sort(registryEraRanges, CompareEraRanges);

            // Clean up era information
            for (int i = 0; i < registryEraRanges.Length; i++)
            {
                // eras count backwards from length to 1 (and are 1 based indexes into string arrays)
                registryEraRanges[i].era = registryEraRanges.Length - i;

                // update max era year
                if (i == 0)
                {
                    // First range is 'til the end of the calendar
                    registryEraRanges[0].maxEraYear = GregorianCalendar.MaxYear - registryEraRanges[0].yearOffset;
                }
                else
                {
                    // Rest are until the next era (remember most recent era is first in array)
                    registryEraRanges[i].maxEraYear = registryEraRanges[i-1].yearOffset + 1 - registryEraRanges[i].yearOffset;
                }
            }
#endif
            // Return our ranges
            return registryEraRanges;
        }
开发者ID:stormleoxia,项目名称:referencesource,代码行数:92,代码来源:japanesecalendar.cs


示例5: LoadReport

 private void LoadReport(string path, List<ViewLvApplication> _Employee, string date)
 {
     string _Header = title;
     this.ReportViewer1.LocalReport.DisplayName = title;
     ReportViewer1.ProcessingMode = ProcessingMode.Local;
     ReportViewer1.LocalReport.ReportPath = Server.MapPath(path);
     System.Security.PermissionSet sec = new System.Security.PermissionSet(System.Security.Permissions.PermissionState.Unrestricted);
     ReportViewer1.LocalReport.SetBasePermissionsForSandboxAppDomain(sec);
     IEnumerable<ViewLvApplication> ie;
     ie = _Employee.AsQueryable();
     ReportDataSource datasource1 = new ReportDataSource("DataSet1", ie);
     ReportViewer1.LocalReport.DataSources.Clear();
     ReportViewer1.LocalReport.DataSources.Add(datasource1);
     ReportParameter rp = new ReportParameter("Header", _Header, false);
     this.ReportViewer1.LocalReport.SetParameters(new ReportParameter[] { rp });
     ReportViewer1.LocalReport.Refresh();
 }
开发者ID:qq5013,项目名称:WMS-Fatima,代码行数:17,代码来源:ReportContainer.aspx.cs


示例6: LoadReport

        private void LoadReport(string path, List<ViewAttData> _Employee, string date)
        {
            string _Header = title;
            this.ReportViewer1.LocalReport.DisplayName = title;
            ReportViewer1.ProcessingMode = ProcessingMode.Local;
            ReportViewer1.LocalReport.ReportPath = Server.MapPath(path);
            System.Security.PermissionSet sec = new System.Security.PermissionSet(System.Security.Permissions.PermissionState.Unrestricted);
            ReportViewer1.LocalReport.SetBasePermissionsForSandboxAppDomain(sec);
            IEnumerable<ViewAttData> ie;
            ie = _Employee.AsQueryable();
            IEnumerable<EmpPhoto> companyImage;
            companyImage = companyimage.AsQueryable();
            ReportViewer1.LocalReport.DataSources.Clear();
            ReportDataSource datasource1 = new ReportDataSource("DataSet1", ie);
            ReportDataSource datasource2 = new ReportDataSource("DataSet2", companyImage);

            ReportViewer1.HyperlinkTarget = "_blank";

            ReportViewer1.LocalReport.DataSources.Add(datasource1);
            ReportViewer1.LocalReport.DataSources.Add(datasource2);
            ReportParameter rp = new ReportParameter("Date", date, false);
            ReportParameter rp1 = new ReportParameter("Header", _Header, false);
            this.ReportViewer1.LocalReport.SetParameters(new ReportParameter[] { rp, rp1 });
            ReportViewer1.LocalReport.Refresh();
        }
开发者ID:ahsinanwar,项目名称:SingleCompany,代码行数:25,代码来源:ReportContainer.aspx.cs


示例7: LoadReport

 private void LoadReport(string path, List<DailySummary> _Summary,string rptName)
 {
     string _Header = rptName;
     this.ReportViewer1.LocalReport.DisplayName = rptName;
     ReportViewer1.ProcessingMode = ProcessingMode.Local;
     ReportViewer1.LocalReport.ReportPath = Server.MapPath(path);
     System.Security.PermissionSet sec = new System.Security.PermissionSet(System.Security.Permissions.PermissionState.Unrestricted);
     ReportViewer1.LocalReport.SetBasePermissionsForSandboxAppDomain(sec);
     ReportDataSource datasource1 = new ReportDataSource("DataSet1", _Summary);
     ReportViewer1.LocalReport.DataSources.Clear();
     ReportViewer1.LocalReport.DataSources.Add(datasource1);
     ReportParameter rp = new ReportParameter("CompanyName", "National Highway Authority", false);
     ReportParameter rp1 = new ReportParameter("Title", rptName, false);
     ReportParameter rp2 = new ReportParameter("Date", DateTo.ToString("dd-MMM-yyyy") + " to " + DateFrom.ToString("dd-MMM-yyyy"), false);
     this.ReportViewer1.LocalReport.SetParameters(new ReportParameter[] { rp,rp1,rp2 });
     ReportViewer1.LocalReport.Refresh();
 }
开发者ID:ahsinanwar,项目名称:WMSNHA2016,代码行数:17,代码来源:DSSection.aspx.cs


示例8: GetPermissionSet

 private System.Security.PermissionSet GetPermissionSet(ISecurityAttribute securityAttribute) {
   var result = new System.Security.PermissionSet(System.Security.Permissions.PermissionState.None);
   foreach (var attribute in securityAttribute.Attributes) {
     var permission = this.GetPermission(securityAttribute.Action, attribute);
     if (permission == null) continue; //not a trusted permission
     result.AddPermission(permission);
   }
   return result;
 }
开发者ID:modulexcite,项目名称:Microsoft.Cci.Metadata,代码行数:9,代码来源:Emitter.cs


示例9: CreateAppDomain

        void CreateAppDomain()
        {
            System.AppDomainSetup pythonAppDomainSetup = new AppDomainSetup();
            pythonAppDomainSetup.ApplicationBase = ".";

            bool usePermissionTest = false;
            if (usePermissionTest)
            {
                System.Security.PermissionSet permissionSet = new System.Security.PermissionSet(System.Security.Permissions.PermissionState.None);
                permissionSet.AddPermission(new System.Security.Permissions.SecurityPermission(System.Security.Permissions.SecurityPermissionFlag.Execution));
                //permissionSet.AddPermission(new System.Security.Permissions.FileIOPermission(System.Security.Permissions.PermissionState.Unrestricted));

                compilerAppDomain = System.AppDomain.CreateDomain("Python App Domain", null, pythonAppDomainSetup, permissionSet, null);
            }
            else
            {
                compilerAppDomain = System.AppDomain.CreateDomain("Python App Domain");
            }

            Dictionary<string, object> options = new Dictionary<string, object>();
            options["Debug"] = true;
        }
开发者ID:glocklueng,项目名称:agg-sharp,代码行数:22,代码来源:MatterCadWidget.cs


示例10: LoadReportLateIn

 private void LoadReportLateIn(string path, List<ViewAttData> _Employee, string date)
 {
     List<ViewAttData> attData = new List<ViewAttData>();
     foreach (var item in _Employee)
     {
         TimeSpan dtLateIn = new TimeSpan();
         dtLateIn = new TimeSpan(09, 0, 0);
         if (item.TimeIn.Value.TimeOfDay > dtLateIn || item.WorkMin<480)
         {
             attData.Add(item);
         }
     }
     string _Header = title;
     this.ReportViewer1.LocalReport.DisplayName = title;
     ReportViewer1.ProcessingMode = ProcessingMode.Local;
     ReportViewer1.LocalReport.ReportPath = Server.MapPath(path);
     System.Security.PermissionSet sec = new System.Security.PermissionSet(System.Security.Permissions.PermissionState.Unrestricted);
     ReportViewer1.LocalReport.SetBasePermissionsForSandboxAppDomain(sec);
     IEnumerable<ViewAttData> ie;
     ie = attData.AsQueryable();
     ReportDataSource datasource1 = new ReportDataSource("DataSet1", ie);
     ReportViewer1.LocalReport.DataSources.Clear();
     ReportViewer1.LocalReport.DataSources.Add(datasource1);
     ReportParameter rp = new ReportParameter("Date", date, false);
     ReportParameter rp1 = new ReportParameter("Header", _Header, false);
     this.ReportViewer1.LocalReport.SetParameters(new ReportParameter[] { rp, rp1 });
     ReportViewer1.LocalReport.Refresh();
 }
开发者ID:ahsinanwar,项目名称:WMSNHA2016,代码行数:28,代码来源:ReportContainer.aspx.cs


示例11: LoadReport

 private void LoadReport(string PathString, List<VMPosting> list, string title, string date)
 {
     string _Header = "Posting Record";
     string Date = Convert.ToDateTime(_dateFrom).Date.ToString("dd-MMM-yyyy");
     this.ReportViewer1.LocalReport.DisplayName = PathString;
     ReportViewer1.ProcessingMode = ProcessingMode.Local;
     ReportViewer1.LocalReport.ReportPath = Server.MapPath(PathString);
     System.Security.PermissionSet sec = new System.Security.PermissionSet(System.Security.Permissions.PermissionState.Unrestricted);
     ReportViewer1.LocalReport.SetBasePermissionsForSandboxAppDomain(sec);
     IEnumerable<VMPosting> ie;
     ie = list.AsQueryable();
     ReportDataSource datasource1 = new ReportDataSource("DataSet1", ie);
     ReportViewer1.LocalReport.DataSources.Clear();
     ReportViewer1.LocalReport.DataSources.Add(datasource1);
     ReportParameter rp = new ReportParameter("Header", _Header, false);
     ReportParameter rp1 = new ReportParameter("Date", Date, false);
     this.ReportViewer1.LocalReport.SetParameters(new ReportParameter[] { rp, rp1 });
     ReportViewer1.LocalReport.Refresh();
 }
开发者ID:ahsinanwar,项目名称:WMSNHA2016,代码行数:19,代码来源:ReportContainer.aspx.cs


示例12: EnlistDistributedTransactionHelper

        // NOTE: This is just a private helper because OracleClient V1.1 shipped
        // with a different argument name and it's a breaking change to not use
        // the same argument names in V2.0 (VB Named Parameter Binding--Ick)
        private void EnlistDistributedTransactionHelper(System.EnterpriseServices.ITransaction transaction) {
            System.Security.PermissionSet permissionSet = new System.Security.PermissionSet(System.Security.Permissions.PermissionState.None);
            permissionSet.AddPermission(CONNECTIONOBJECTNAME.ExecutePermission); // MDAC 81476
            permissionSet.AddPermission(new System.Security.Permissions.SecurityPermission(System.Security.Permissions.SecurityPermissionFlag.UnmanagedCode));
            permissionSet.Demand();

            Bid.Trace( "<prov.DbConnectionHelper.EnlistDistributedTransactionHelper|RES|TRAN> %d#, Connection enlisting in a transaction.\n", ObjectID);
            SysTx.Transaction indigoTransaction = null;

            if (null != transaction) {
                indigoTransaction = SysTx.TransactionInterop.GetTransactionFromDtcTransaction((SysTx.IDtcTransaction)transaction);
            }

            RepairInnerConnection();
            // NOTE: since transaction enlistment involves round trips to the
            // server, we don't want to lock here, we'll handle the race conditions
            // elsewhere.
            InnerConnection.EnlistTransaction(indigoTransaction);

            // NOTE: If this outer connection were to be GC'd while we're
            // enlisting, the pooler would attempt to reclaim the inner connection
            // while we're attempting to enlist; not sure how likely that is but
            // we should consider a GC.KeepAlive(this) here.
            GC.KeepAlive(this);
        }
开发者ID:uQr,项目名称:referencesource,代码行数:28,代码来源:DbConnectionHelper.cs


示例13: InstantiatePermissionAttributes

 protected System.Security.PermissionSet InstantiatePermissionAttributes()
 {
     System.Security.PermissionSet permissions = new System.Security.PermissionSet(System.Security.Permissions.PermissionState.None);
     AttributeList permissionAttributes = this.PermissionAttributes;
     for(int i = 0, n = permissionAttributes == null ? 0 : permissionAttributes.Count; i < n; i++)
     {
         //^ assert permissionAttributes != null;
         object result = this.GetPermissionOrSetOfPermissionsFromAttribute(permissionAttributes[i]);
         if(result == null)
             continue;
         if(result is System.Security.PermissionSet)
             permissions = permissions.Union((System.Security.PermissionSet)result);
         else
         {
             System.Security.IPermission permission = result as System.Security.IPermission;
             if(permission == null)
                 continue;
             permissions.AddPermission(permission);
         }
     }
     return permissions;
 }
开发者ID:modulexcite,项目名称:SHFB-1,代码行数:22,代码来源:Nodes.cs


示例14: CreatePermission

 private System.Security.IPermission CreatePermission(System.Security.Permissions.SecurityAttribute/*!*/ secAttr)
 {
     //This could execute partially trusted code, so set up a very restrictive execution environment
     System.Security.PermissionSet perm = new System.Security.PermissionSet(System.Security.Permissions.PermissionState.None);
     //TODO: add permissions if the attribute is from a trusted assembly
     perm.PermitOnly();
     try
     {
         return secAttr.CreatePermission();
     }
     catch { }
     return null;
 }
开发者ID:modulexcite,项目名称:SHFB-1,代码行数:13,代码来源:Nodes.cs


示例15: LoadReport

 private void LoadReport(string PathString, List<ViewServiceLog> _ViewServiceLog, string date, string title)
 {
     string _Header = title;
     this.ReportViewer1.LocalReport.DisplayName = title;
     ReportViewer1.ProcessingMode = ProcessingMode.Local;
     ReportViewer1.LocalReport.ReportPath = Server.MapPath(PathString);
     System.Security.PermissionSet sec = new System.Security.PermissionSet(System.Security.Permissions.PermissionState.Unrestricted);
     ReportViewer1.LocalReport.SetBasePermissionsForSandboxAppDomain(sec);
     ReportDataSource datasource1 = new ReportDataSource("DataSet1", _ViewServiceLog);
     ReportViewer1.LocalReport.DataSources.Clear();
     ReportViewer1.LocalReport.DataSources.Add(datasource1);
     ReportParameter rp = new ReportParameter("CompanyName", "National Highway Authority", false);
     ReportParameter rp1 = new ReportParameter("Title", title, false);
     ReportParameter rp2 = new ReportParameter("Date", date, false);
     this.ReportViewer1.LocalReport.SetParameters(new ReportParameter[] { rp, rp1, rp2 });
     ReportViewer1.LocalReport.Refresh();
 }
开发者ID:linkstatic12,项目名称:NHAWMS,代码行数:17,代码来源:ReportContainer.aspx.cs


示例16: LoadReport

 private void LoadReport(string path, List<ViewAttData> _Employee)
 {
     string DateToFor = "";
     if (DateFrom.Date.ToString("d") == DateTo.ToString("d"))
     {
         DateToFor = "Date : " + DateFrom.Date.ToString("d");
     }
     else
     {
         DateToFor = "From : " + DateFrom.Date.ToString("d") + " To: " + DateTo.Date.ToString("d");
     }
     string _Header = "Overtime Report";
     this.ReportViewer1.LocalReport.DisplayName = "OverTime Report";
     ReportViewer1.ProcessingMode = ProcessingMode.Local;
     ReportViewer1.LocalReport.ReportPath = Server.MapPath(path);
     System.Security.PermissionSet sec = new System.Security.PermissionSet(System.Security.Permissions.PermissionState.Unrestricted);
     ReportViewer1.LocalReport.SetBasePermissionsForSandboxAppDomain(sec);
     IEnumerable<ViewAttData> ie;
     ie = _Employee.AsQueryable();
     ReportDataSource datasource1 = new ReportDataSource("DataSet1", ie);
     ReportViewer1.LocalReport.DataSources.Clear();
     ReportViewer1.LocalReport.DataSources.Add(datasource1);
     ReportParameter rp = new ReportParameter("Date", DateToFor, false);
     ReportParameter rp1 = new ReportParameter("Header", _Header, false);
     this.ReportViewer1.LocalReport.SetParameters(new ReportParameter[] { rp, rp1 });
     ReportViewer1.LocalReport.Refresh();
 }
开发者ID:qq5013,项目名称:WMS-Fatima,代码行数:27,代码来源:DOverTime.aspx.cs


示例17: GetFullNameFromProfile

        string GetFullNameFromProfile()
        {
            string FullName = string.Empty;
            try
            {
                System.Security.PermissionSet ps = new System.Security.PermissionSet(System.Security.Permissions.PermissionState.Unrestricted);
                ps.Assert();

                Microsoft.SharePoint.SPServiceContext serviceContext = Microsoft.SharePoint.SPServiceContext.Current;
                UserProfileManager upm = new Microsoft.Office.Server.UserProfiles.UserProfileManager(serviceContext);
                ProfileSubtypePropertyManager pspm = upm.DefaultProfileSubtypeProperties;

                UserProfile profile = upm.GetUserProfile(true);
                FullName = profile["FirstName"].Value + " " + profile["LastName"].Value;
            }
            catch (Exception) { }
            return FullName;
        }
开发者ID:NIEM-Web,项目名称:Sharepoint,代码行数:18,代码来源:UserStatusLink.ascx.cs


示例18: DisplayProfile

        private void DisplayProfile()
        {
            try
            {
                System.Security.PermissionSet ps = new System.Security.PermissionSet(System.Security.Permissions.PermissionState.Unrestricted);
                ps.Assert();

                Microsoft.SharePoint.SPServiceContext serviceContext = Microsoft.SharePoint.SPServiceContext.Current;
                UserProfileManager upm = new Microsoft.Office.Server.UserProfiles.UserProfileManager(serviceContext);
                ProfileSubtypePropertyManager pspm = upm.DefaultProfileSubtypeProperties;

                UserProfile profile = upm.GetUserProfile(true); //_accountName);

                this.Controls.Add(new Literal() { Text = "<table border='0' > <tr><td>Displayname</td><td>Value</td></tr>" });

                string[] props = { "UserName", "FirstName", "LastName", "WorkEmail", "Department" };

                foreach (string prop in props)
                {

                    string text = string.Format("<tr><td>{0}</td><td>{1}</td></tr>",
                           profile[prop].ProfileSubtypeProperty.DisplayName,
                           profile[prop].Value);

                    this.Controls.Add(new Literal() { Text = text });

                }
                string txtEdit = "<tr><td colspan='2'>";
                btnEdit = new Button() { Text = "Edit" };

                this.Controls.Add(new Literal() { Text = txtEdit });
                this.Controls.Add(btnEdit);
                this.Controls.Add(new Literal() { Text = "</td></tr>" });
                btnEdit.Click += new EventHandler(btnEdit_Click);

                /*
                foreach (ProfileSubtypeProperty prop in pspm.PropertiesWithSection)
                {

                    if (prop.IsSection)
                        this.Controls.Add(new Literal() { Text = string.Format("<tr><td colspan='3'><b>Section: {0}</b></td></tr>", prop.DisplayName) });
                    else
                    {
                        string text = string.Format("<tr><td>{0}</td><td>{1}</td><td>{2}</td></tr>",
                            prop.DisplayName,
                            prop.Name,
                            profile[prop.Name].Value);

                        this.Controls.Add(new Literal() { Text = text });
                    }
                }*/
                this.Controls.Add(new Literal() { Text = "</table>" });
            }
            catch (Exception ex)
            {
                this.Controls.Add(new Literal() { Text = ex.ToString() });
            }
            finally
            {
                System.Security.CodeAccessPermission.RevertAssert();
            }
        }
开发者ID:NIEM-Web,项目名称:Sharepoint,代码行数:62,代码来源:NiemUserProfileWebPart.cs


示例19: LoadReport

 private void LoadReport(string path, List<ViewMonthlyDataPer> _Employee)
 {
     string _Header = "Monthly Summary for Permanent Employees";
     this.ReportViewer1.LocalReport.DisplayName = "Monthly Summary Report";
     string _Date = "Month: " + DateTo.Date.ToString("MMMM") + " , " + DateTo.Year.ToString();
     ReportViewer1.ProcessingMode = ProcessingMode.Local;
     ReportViewer1.LocalReport.ReportPath = Server.MapPath(path);
     System.Security.PermissionSet sec = new System.Security.PermissionSet(System.Security.Permissions.PermissionState.Unrestricted);
     ReportViewer1.LocalReport.SetBasePermissionsForSandboxAppDomain(sec);
     IEnumerable<ViewMonthlyDataPer> ie;
     ie = _Employee.AsQueryable();
     ReportDataSource datasource1 = new ReportDataSource("DataSet1", ie);
     ReportViewer1.LocalReport.DataSources.Clear();
     ReportViewer1.LocalReport.DataSources.Add(datasource1);
     ReportParameter rp = new ReportParameter("Header", _Header, false);
     ReportParameter rp1 = new ReportParameter("Date", _Date, false);
     this.ReportViewer1.LocalReport.SetParameters(new ReportParameter[] { rp, rp1 });
     ReportViewer1.LocalReport.Refresh();
 }
开发者ID:qq5013,项目名称:WMS-Fatima,代码行数:19,代码来源:MSummary.aspx.cs


示例20: DemandPermission

 internal void DemandPermission() {
     if (null == _permissionset) {
         _permissionset = CreatePermissionSet();
     }
     _permissionset.Demand();
 }
开发者ID:uQr,项目名称:referencesource,代码行数:6,代码来源:DbConnectionOptions.cs



注:本文中的System.Security.PermissionSet类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Security.SecurityElement类代码示例发布时间:2022-05-24
下一篇:
C# Cryptography.SHA1CryptoServiceProvider类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap