我想我已经为你准备好了.
我有一些加密和解密字符串的C#代码.它看起来像这样:
public static string EncryptString(String toEncrypt, String key)
{
Debug.WriteLine("Encrypting string: " + toEncrypt + "&key:" + key);
Rijndael AES = Rijndael.Create();
AES.KeySize = 128;
AES.BlockSize = 128;
AES.Mode = CipherMode.ECB;
AES.Padding = PaddingMode.Zeros;
MD5CryptoServiceProvider Hasher = new MD5CryptoServiceProvider();
AES.Key = Hasher.ComputeHash(UTF8Encoding.UTF8.GetBytes(key));
ICryptoTransform crypto = AES.CreateEncryptor(AES.Key, AES.IV);
byte[] txt = UTF8Encoding.UTF8.GetBytes( HEADER + toEncrypt);
byte[] cipherText = crypto.TransformFinalBlock(txt, 0, txt.Length);
return Convert.ToBase64String(cipherText);;
}
Run Code Online (Sandbox Code Playgroud)
当我在C#中加密或解密时,它就像一个魅力.在PHP中我有一个解密算法,如下所示:
if($msg!= "" && $key != "")
{
$msg = parseMsg($msg);
mcrypt_get_key_size ( MCRYPT_RIJNDAEL_128, MCRYPT_MODE_ECB);
$decrypted …Run Code Online (Sandbox Code Playgroud) 编辑:海报答案是正确的,除了它应该读取包含xmlns ="http://schemas.microsoft.com/office/2009/07/customui".作为副作用,XML文件中定义的功能区和上下文菜单在Office 2007中不起作用.如果需要在2007中添加上下文菜单,请使用现在已弃用的,并且Outlook 2007消息窗口中的上下文菜单不可用.
this.Application.ItemContextMenuDisplay += new Microsoft.Office.Interop.Outlook.ApplicationEvents_11_ItemContextMenuDisplayEventHandler(Application_ItemContextMenuDisplay);
Run Code Online (Sandbox Code Playgroud)
我已创建了功能区和上下文菜单,但我不知道如何同时部署它们.
我的Ribbon XML看起来像这样:
<?xml version="1.0" encoding="UTF-8"?>
<customUI onLoad="Ribbon_Load" xmlns="http://schemas.microsoft.com/office/2006/01/customui">
<ribbon>
<tabs>
<tab id="testTab" label="Test Label">
<group id="testGroup" label="test">
<button id="testButton" onAction="testAction" label="Test" size="large"
getImage ="GetCustomImage" screentip="Test Ribbon Functionality."/>
</group>
</tab>
</tabs>
</ribbon>
</customUI>
Run Code Online (Sandbox Code Playgroud)
Ribbon.cs有
public string GetCustomUI(string ribbonID)
{
String ui = null;
// Examine the ribbonID to see if the current item
// is a Mail inspector.
if (ribbonID == "Microsoft.Outlook.Mail.Read" ||
ribbonID == "Microsoft.Outlook.Mail.Compose")
{
// Retrieve the customized Ribbon …Run Code Online (Sandbox Code Playgroud) 我有一个Outlook 2010插件,我正在尝试创建一个自定义上下文菜单项.每当用户进入Message正文并右键单击时,我想让我的插件对所选文本执行一些操作.我有一个功能区栏已经有我想要的动作,但我不知道如何实际创建上下文菜单项.我已经为MailItems找到了一些教程,但它们似乎在消息体中不起作用.我不想使用IContextMenuDisplay,因为它已被弃用.
有人可以帮忙吗?
我发现:
http://www.developerzen.com/2005/04/04/adding-a-button-to-outlooks-context-menu/ http://weblogs.asp.net/avnerk/archive/2007/01/03/ vsto-for-outlook-2007-building-the-add-in-part-2.aspx http://www.roelvanlisdonk.nl/?p=1184
编辑:我已经意识到邮件正在使用Word上下文菜单,这是否可以用word?
Base64编码通常用于混淆明文,我想知道是否有任何快速/简单的方法来混淆基本64字符串,因此它不容易识别.为此,该方法应该对填充字符(='s)进行模糊处理,使它们成为其他符号并且更加分散.
有谁知道一种简单(易于翻转)的方法吗?
你可以使用移位密码,但我正在寻找一些更全面的东西,例如,如果我的移位密码映射= a,有人可能会注意到一个经常以a结尾的字符串.
目的不是为了增加安全性,实际上只是让base64无法识别为base 64.它也不需要传递安全性proffesional,只需要知道base64是什么以及它看起来像什么.Ex(=最后等)
我描述的方法可能会添加非基数64个字符,比如^%$#@ !,以帮助混淆读者.
大多数回复似乎是关于为什么我想要这样做的主题,基本的答案是操作将完成多次(所以我想要一些便宜的东西),并以一种没有密码的方式完成记得(为什么我不做异或).此外,数据不是高度敏感的,并且只是用作针对临时用户的方法,后者可能知道基本64字符串是什么.
基本上我正在尝试返回从Ajax请求中获取的名称列表.当只有一个名字时,它完美无缺.但是有多个名字,我开始看到我无法解释的行为.
function getIDFromInput(input){
sendToID = new Array; //An Array of "Name :Id"
$.ajax({
type:"GET",
url: "user_search.php",
contentType:"application/x-www-form-urlencoded; charset=utf-8",
dataType:"json",
async:false,
data: "q="+input,
success:function(data){
if(data.success){
var userLength = data.success.length;
if(userLength == 1){ // For one user everything works fine
var userNum = data.success.users[0];
var userName = data.success.usersNames[userNum];
sendToID[0] = userName + " :"+userNum;
}
else if(userLength > 1){ // Multiple users it fails
for(i = 0; i < userLength; i++){
var userNum = data.success.users[i];
//this call works
var userName = data.success.usersNames[userNum]; …Run Code Online (Sandbox Code Playgroud) c# ×2
vsto ×2
add-in ×1
ajax ×1
base64 ×1
contextmenu ×1
encryption ×1
javascript ×1
jquery ×1
json ×1
obfuscation ×1
outlook ×1
php ×1
ribbon ×1
utf-8 ×1