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


C# LosFormatter.Deserialize方法代码示例

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


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

示例1: Load

 public override void Load()
 {
     IPersistViewState state = Ra.Brix.Data.Internal.Adapter.Instance as IPersistViewState;
     LosFormatter formatter = new LosFormatter();
     Pair pair = formatter.Deserialize(state.Load(_session.ToString(), Page.Request.Url.ToString())) as Pair;
     ViewState = pair.First;
     ControlState = pair.Second;
 }
开发者ID:greaterwinner,项目名称:ra-brix,代码行数:8,代码来源:RaBrixPageStatePersister.cs

示例2: LoadPageStateFromCompressedViewState

 protected object LoadPageStateFromCompressedViewState()
 {
     string viewState = Request.Form["__VSTATE"];
     byte[] bytes = Convert.FromBase64String(viewState);
     bytes = IntegrationWebSiteMvc.Classes.Compressor.Decompress(bytes);
     LosFormatter formatter = new LosFormatter();
     return formatter.Deserialize(Convert.ToBase64String(bytes));
 }
开发者ID:bedford603067,项目名称:Augment,代码行数:8,代码来源:AssetAttributes.aspx.cs

示例3: Ctor0_Deny_Unrestricted

		public void Ctor0_Deny_Unrestricted ()
		{
			LosFormatter lf = new LosFormatter ();

			MemoryStream ms = new MemoryStream ();
			lf.Serialize (ms, "mono");
			ms.Position = 0;
			Assert.IsNotNull (lf.Deserialize (ms), "Deserialize(Stream)");

			StringWriter sw = new StringWriter ();
			lf.Serialize (sw, "mono");
			string s = sw.ToString ();
			StringReader sr = new StringReader (s);
			Assert.IsNotNull (lf.Deserialize (sr), "Deserialize(TextReader)");

			Assert.IsNotNull (lf.Deserialize (s), "Deserialize(string)");
		}
开发者ID:nobled,项目名称:mono,代码行数:17,代码来源:LosFormatterCas.cs

示例4: Load

 public override void Load()
 {
     string viewStateString = Page.Request["__AJAXVIEWSTATE"];
     viewStateString = viewStateString.Replace(",", "").Replace(" ", "");
     LosFormatter los = new LosFormatter();
     Pair pair = (Pair)los.Deserialize(viewStateString);
     base.ViewState = pair.First;
     base.ControlState = pair.Second;
 }
开发者ID:Houfeng,项目名称:AjaxEngine,代码行数:9,代码来源:HiddenFieldPageStatePersister.cs

示例5: Deserialize_Stream_NonSeekable

		[Test] // bug #411115
		public void Deserialize_Stream_NonSeekable ()
		{
			string s1 = "Hello world";
			NonSeekableStream ns = new NonSeekableStream ();
			LosFormatter lf = new LosFormatter ();
			lf.Serialize (ns, s1);
			ns.Reset ();
			string s2 = lf.Deserialize (ns) as string;
			Assert.AreEqual (s1, s2);
		}
开发者ID:calumjiao,项目名称:Mono-Class-Libraries,代码行数:11,代码来源:LosFormatterTest.cs

示例6: LoadPageStateFromPersistenceMedium

		protected override object LoadPageStateFromPersistenceMedium()
		{
			_formatter = new LosFormatter();
			object o;

			string vsString = Request.Form["__COMPRESSEDVIEWSTATE"];
			string outStr = new ComDePress().DeCompress(vsString);
			o = _formatter.Deserialize(outStr);
			return o;
		}
开发者ID:alexan1,项目名称:marketweb,代码行数:10,代码来源:CompressedVSBasePage.cs

示例7: LoadPageStateFromPersistenceMedium

        protected override object LoadPageStateFromPersistenceMedium()
        {
            string vState = this.Request.Form["__VSTATE"];
            byte[] bytes = System.Convert.FromBase64String( vState );

            bytes = this.Decompress( bytes );

            LosFormatter format = new LosFormatter();
            return format.Deserialize( System.Convert.ToBase64String( bytes ) );
        }
开发者ID:popovegor,项目名称:gt,代码行数:10,代码来源:GTCommonWebPage.cs

示例8: LoadPageStateFromPersistenceMedium

        protected override object LoadPageStateFromPersistenceMedium()
        {
            string viewState = Request.Form["__VSTATE"];
            byte[] bytes = Convert.FromBase64String(viewState);
            LosFormatter formatter = new LosFormatter();

            bytes = bytes.Decompress();

            return formatter.Deserialize(Convert.ToBase64String(bytes));
        }
开发者ID:gabla5,项目名称:SO-Answers,代码行数:10,代码来源:CompressPageViewState.aspx.cs

示例9: Serialize

		[Test] // bug #324526
		public void Serialize ()
		{
			string s = "Hello world";
			LosFormatter lf = new LosFormatter ();
			StringWriter sw = new StringWriter ();
			lf.Serialize (sw, s);
			string s1 = sw.ToString ();
			Assert.IsNotNull (s1, "#1");
			string s2 = lf.Deserialize (s1) as string;
			Assert.IsNotNull (s2, "#2");
			Assert.AreEqual (s, s2, "#3");
		}
开发者ID:calumjiao,项目名称:Mono-Class-Libraries,代码行数:13,代码来源:LosFormatterTest.cs

示例10: Load

		public override void Load()
		{
			string id = _session.ToString() + "|" + Page.Request.Url.ToString();
            LosFormatter formatter = new LosFormatter();

			if (Page.Session[id] == null)
				throw new ArgumentException("session timeout ...");

			string obj = Page.Session[id] as string;
            Pair pair = formatter.Deserialize(obj) as Pair;
            ViewState = pair.First;
            ControlState = pair.Second;
		}
开发者ID:polterguy,项目名称:magix,代码行数:13,代码来源:Magix_PageStatePersister.cs

示例11: LoadPageStateFromPersistenceMedium

        protected override object LoadPageStateFromPersistenceMedium()
        {
            object state = null;

            StreamReader reader = new StreamReader(GenerateFileName());

            LosFormatter formator = new LosFormatter();

            state = formator.Deserialize(reader);

            reader.Close();

            return state;
        }
开发者ID:NewPointe,项目名称:Rockit,代码行数:14,代码来源:RockPageMod.cs

示例12: LoadPageStateFromPersistenceMedium

 protected override object LoadPageStateFromPersistenceMedium()
 {
     object retVal;
     string id = Request.Form["__VIEWSTATE_UniqueID"];
     byte[] bytes = null;
     _config = (ViewStateConfiguration) ConfigurationManager.GetSection("ViewStateConfiguration");
     this._viewstateStorage = ViewstateStorageFactory.GetStorageMedium();
     bytes = Convert.FromBase64String(this._viewstateStorage.Get(id).Value);
     if (_config.Compression)
         bytes = bytes.Decompress();
     LosFormatter formatter = new LosFormatter();
     retVal = formatter.Deserialize(Convert.ToBase64String(bytes));
     return retVal;
 }
开发者ID:JasonSoft,项目名称:JasonSoft,代码行数:14,代码来源:NoViewStateBasePage.cs

示例13: LoadPageStateFromPersistenceMedium

		/// <summary>
		/// Loads any saved view-state information to the <see cref="T:System.Web.UI.Page"></see> object.
		/// </summary>
		/// <returns>The saved view state.</returns>
		protected override object LoadPageStateFromPersistenceMedium()
		{
			String viewState =  Request.Params[ViewStateKey];

			if (viewState == null)
			{
				return null;
			}
			else
			{
				LosFormatter formatter = new LosFormatter();
				return formatter.Deserialize(viewState);
			}
		}
开发者ID:nats,项目名称:castle-1.0.3-mono,代码行数:18,代码来源:MasterPageBase.cs

示例14: LoadPageStateFromPersistenceMedium

        // De-serialize view state
        protected override object LoadPageStateFromPersistenceMedium()
        {
            var isCompressed = true;

            var compressedViewState = Request.Form[_compressedViewState];
            isCompressed = Convert.ToBoolean(Convert.ToInt32(compressedViewState.Substring(0, 1)));
            compressedViewState = compressedViewState.Remove(0, 1);
            var bytes = Convert.FromBase64String(compressedViewState);

            if(isCompressed)
                bytes = Compressor.Decompress<byte[]>(bytes);
            var losformatter = new LosFormatter();
            return losformatter.Deserialize(Convert.ToBase64String(bytes));
        }
开发者ID:DeonHeyns,项目名称:heynslibrary,代码行数:15,代码来源:CompressedBasePage.cs

示例15: Deserialize

        // Create a logger for use in this class
        /*
        private static readonly log4net.ILog log
        = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
        */
        protected virtual void Deserialize(Stream s)
        {
            // Deserialize the storageConfig
            System.Web.UI.LosFormatter scFormatter = new System.Web.UI.LosFormatter();
            Hashtable ht = (Hashtable)scFormatter.Deserialize(s);

            // Convert to a NameValueCollection.  We only use Hashtable for serialization because
            // LosFormatter can serialize it efficiently.
            if (ht != null)
            {
                foreach (string key in ht.Keys)
                {
                    this[key] = (string)ht[key];
                }
            }
        }
开发者ID:abdul-baten,项目名称:hbcms,代码行数:21,代码来源:ArmoredNameValueCollection.cs


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