当前位置: 首页>>代码示例>>C#>>正文


C# PortalSecurity.Decrypt方法代码示例

本文整理汇总了C#中DotNetNuke.Security.PortalSecurity.Decrypt方法的典型用法代码示例。如果您正苦于以下问题:C# PortalSecurity.Decrypt方法的具体用法?C# PortalSecurity.Decrypt怎么用?C# PortalSecurity.Decrypt使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在DotNetNuke.Security.PortalSecurity的用法示例。


在下文中一共展示了PortalSecurity.Decrypt方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: DecryptParameter

 public static string DecryptParameter( string Value )
 {
     PortalSettings _portalSettings = PortalController.GetCurrentPortalSettings();
     string strKey = _portalSettings.GUID.ToString(); // restrict the key to 6 characters to conserve space
     PortalSecurity objSecurity = new PortalSecurity();
     return objSecurity.Decrypt( strKey, Value );
 }
开发者ID:huayang912,项目名称:cs-dotnetnuke,代码行数:7,代码来源:UrlUtils.cs

示例2: DecryptParameter

 public static string DecryptParameter(string value, string encryptionKey)
 {
     var objSecurity = new PortalSecurity();
     //[DNN-8257] - Can't do URLEncode/URLDecode as it introduces issues on decryption (with / = %2f), so we use a modifed Base64
     value = value.Replace("_", "/");
     value = value.Replace("-", "+");
     value = value.Replace("%3d", "=");
     return objSecurity.Decrypt(encryptionKey, value);
 }
开发者ID:VegasoftTI,项目名称:Dnn.Platform,代码行数:9,代码来源:UrlUtils.cs

示例3: DeserializeMessage

        private EventMessage DeserializeMessage( string filePath, string subscriberId )
        {
            EventMessage message = new EventMessage();
            StreamReader oStreamReader = File.OpenText( filePath );
            string messageString = oStreamReader.ReadToEnd();
            if( messageString.IndexOf( "EventMessage" ) < 0 )
            {
                PortalSecurity oPortalSecurity = new PortalSecurity();
                messageString = oPortalSecurity.Decrypt( EventQueueConfiguration.GetConfig().EventQueueSubscribers[subscriberId].PrivateKey, messageString );
            }
            message.Deserialize( messageString );
            oStreamReader.Close();

            //remove the persisted message from the queue if it has expired
            if( message.ExpirationDate < DateTime.Now )
            {
                File.Delete( filePath );
            }

            return message;
        }
开发者ID:huayang912,项目名称:cs-dotnetnuke,代码行数:21,代码来源:EventQueueController.cs

示例4: PersonalizeSystemMessage

        /// <Summary>Does the replacement of tags on a givem message.</Summary>
        /// <Param name="MessageValue">The message to be formatted.</Param>
        /// <Param name="Prefix">The prefix to look for supported tags.</Param>
        /// <Param name="objObject">
        /// An object used to look for replacement values.
        /// </Param>
        /// <Param name="objType">
        /// Object type for the object used to look for replacement values.
        /// </Param>
        /// <Returns>The message with the found tags replaced.</Returns>
        private static string PersonalizeSystemMessage( string messageValue, string prefix, object objObject, Type objType )
        {
            string strPropertyValue = "";

            ArrayList objProperties = CBO.GetPropertyInfo(objType);

            for (int intProperty = 0; intProperty < objProperties.Count; intProperty++)
            {
                string strPropertyName = ((PropertyInfo)objProperties[intProperty]).Name;
                if (Strings.InStr(1, messageValue, "[" + prefix + strPropertyName + "]", CompareMethod.Text) != 0)
                {
                    PropertyInfo propInfo = (PropertyInfo)objProperties[intProperty];
                    object propValue = propInfo.GetValue(objObject, null);

                    if (propValue != null)
                    {
                        strPropertyValue = propValue.ToString();
                    }

                    // special case for encrypted passwords
                    if ((prefix + strPropertyName == "Membership:Password") && Convert.ToString(Globals.HostSettings["EncryptionKey"]) != "")
                    {
                        PortalSecurity objSecurity = new PortalSecurity();
                        strPropertyValue = objSecurity.Decrypt(Globals.HostSettings["EncryptionKey"].ToString(), strPropertyValue);
                    }

                    messageValue = Strings.Replace(messageValue, "[" + prefix + strPropertyName + "]", strPropertyValue, 1, -1, CompareMethod.Text);
                }
            }

            return messageValue;
        }
开发者ID:huayang912,项目名称:cs-dotnetnuke,代码行数:42,代码来源:Localization.cs


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