⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 samplecryptprovider.cs.txt

📁 ajax是未来之星
💻 TXT
字号:
// *******************************************************************************************
//
// Ajax.NET Professional - The free AJAX implementation for the Microsoft.NET Framework
//
// Copyright (C) 2005 Michael Schwarz, info@schwarz-interactive.de
//
// *******************************************************************************************
using System;

namespace AjaxProSample
{
	public class SampleCryptProvider : AjaxPro.IAjaxCryptProvider
	{
		private AjaxPro.IAjaxKeyProvider _key = null;

		#region IAjaxCrypt Member

		public string Encrypt(string json)
		{
			char[] x = new char[json.Length];
			for(int i=0; i<json.Length; i++)
				x[json.Length -1 -i] = json[i];

			return new String(x);
		}

		public string Decrypt(string jsoncrypt)
		{
			return Encrypt(jsoncrypt);
		}

		public AjaxPro.IAjaxKeyProvider KeyProvider
		{
			set
			{
				_key = value;
			}
		}

		public string ClientScript
		{
			get
			{
				string s = @"

var __sampleCrypt = new Object();
__sampleCrypt.encrypt = function(data)
	{
		var d = [];
		for(var i=data.length -1; i>=0; i--)
			d.push(data.substr(i,1));

		return d.join("""");
	}
__sampleCrypt.decrypt = function(data)
	{
		return this.encrypt(data);
	}

AjaxPro.cryptProvider = __sampleCrypt;

";
				return s;
			}
		}

		#endregion

	}


}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -