示例#1
0
 /// <summary>
 /// Encodes the invoke.
 /// </summary>
 /// <param name="method">The method.</param>
 /// <param name="parameter">The parameter.</param>
 /// <param name="encryptKey">The encrypt key.</param>
 /// <param name="package">The package.</param>
 public static void EncodeInvoke(MethodInfo method, object parameters, string encryptKey, ref NetworkInvokePackage package)
 {
     package.Context[METHOD]            = serializer.Serialize<MethodInfo>(method);
     package.Context[METHOD_NAME]       = serializer.Serialize<string>(method.Name);
     package.Context[METHOD_ISGENERIC]  = method.IsGenericMethod;
     package.Context[METHOD_PARAMETERS] = SecurityUtility.DESEncrypt(serializer.Serialize<object>(parameters), encryptKey);
     package.Context[METHOD_INVOKEINFO] = SecurityUtility.DESEncrypt(serializer.Serialize<MethodInvokeInfo>(new MethodInvokeInfo(method)), encryptKey);
 }
示例#2
0
 /// <summary>
 /// Encodes the invoke.
 /// </summary>
 /// <param name="method">The method.</param>
 /// <param name="parameter">The parameter.</param>
 /// <param name="encryptKey">The encrypt key.</param>
 /// <param name="package">The package.</param>
 public static void EncodeInvoke(MethodInfo method, object parameters, string encryptKey, ref NetworkInvokePackage package)
 {
     package.Context[METHOD]            = serializer.Serialize <MethodInfo>(method);
     package.Context[METHOD_NAME]       = serializer.Serialize <string>(method.Name);
     package.Context[METHOD_ISGENERIC]  = method.IsGenericMethod;
     package.Context[METHOD_PARAMETERS] = SecurityUtility.DESEncrypt(serializer.Serialize <object>(parameters), encryptKey);
     package.Context[METHOD_INVOKEINFO] = SecurityUtility.DESEncrypt(serializer.Serialize <MethodInvokeInfo>(new MethodInvokeInfo(method)), encryptKey);
 }
示例#3
0
 /// <summary>
 /// 解码远程过程调用包
 /// </summary>
 /// <param name="package">The package.</param>
 /// <param name="encryptKey">The encrypt key.</param>
 /// <param name="invokeInfo">The invoke info.</param>
 public static void DecodeInvoke(NetworkInvokePackage package, string encryptKey, out MethodInvokeInfo invokeInfo, out object[] parameters)
 {
     invokeInfo = serializer.Deserialize <MethodInvokeInfo>(SecurityUtility.DESDecrypt((byte[])package.Context[METHOD_INVOKEINFO], encryptKey));
     parameters = serializer.Deserialize <object[]>(SecurityUtility.DESDecrypt((byte[])package.Context[METHOD_PARAMETERS], encryptKey));
 }
示例#4
0
 /// <summary>
 /// ����Զ�̹��̵��ð�
 /// </summary>
 /// <param name="package">The package.</param>
 /// <param name="encryptKey">The encrypt key.</param>
 /// <param name="invokeInfo">The invoke info.</param>
 public static void DecodeInvoke(NetworkInvokePackage package, string encryptKey, out MethodInvokeInfo invokeInfo, out object[] parameters)
 {
     invokeInfo = serializer.Deserialize<MethodInvokeInfo>(SecurityUtility.DESDecrypt((byte[])package.Context[METHOD_INVOKEINFO], encryptKey));
     parameters = serializer.Deserialize<object[]>(SecurityUtility.DESDecrypt((byte[])package.Context[METHOD_PARAMETERS], encryptKey));
 }