public byte[] LoadDll(string dllPath, byte level, int sizeKey, byte[] requestSeed, int dlltype, int extraByteSize, byte[] extraByte)
        {
            IntPtr hModule = NativeMethod.LoadLibrary(dllPath);

            if (hModule == IntPtr.Zero)
            {
                return(null);                   //如果dll文件不存在,返回空
            }
            byte[] seedKey = new byte[sizeKey]; //声明seedKey,用于存储返回的key值
            byte[] bytes   = new byte[sizeKey];
            uint   actual  = 0;
            IntPtr intPtr;

            if (dlltype == 0)
            {
                intPtr = NativeMethod.GetProcAddress(hModule, "ES_CalculateKeyFromSeed");
                ES_CalculateKeyFromSeed eS_CalculateKeyFromSeed = (ES_CalculateKeyFromSeed)Marshal.GetDelegateForFunctionPointer(intPtr, typeof(ES_CalculateKeyFromSeed));
                eS_CalculateKeyFromSeed(level, sizeKey, extraByteSize, ref requestSeed[0], ref seedKey[0], ref extraByte[0]);
            }
            else if (dlltype == 1)
            {
                intPtr = NativeMethod.GetProcAddress(hModule, "GenerateKeyExOpt");
                GenerateKeyExOpt generateKeyExOpt = (GenerateKeyExOpt)Marshal.GetDelegateForFunctionPointer(intPtr, typeof(GenerateKeyExOpt));
                generateKeyExOpt(ref requestSeed[0], sizeKey, level, ref bytes[0], ref bytes[0], ref seedKey[0], 8, ref actual);
            }
            else if (dlltype == 2)
            {
                if (intESWSecurityLevel == 0)
                {
                    intPtr = NativeMethod.GetProcAddress(hModule, "CalcKeys");
                    CalcKeys calcKeys = (CalcKeys)Marshal.GetDelegateForFunctionPointer(intPtr, typeof(CalcKeys));
                    calcKeys(ref requestSeed[0], ref seedKey[0], ref bytes[0], ref bytes[0], ref bytes[0]);
                }
                else if (intESWSecurityLevel == 1)
                {
                    intPtr = NativeMethod.GetProcAddress(hModule, "CalcKeys1");
                    CalcKeys1 calcKeys1 = (CalcKeys1)Marshal.GetDelegateForFunctionPointer(intPtr, typeof(CalcKeys1));
                    calcKeys1(ref requestSeed[0], ref seedKey[0], ref bytes[0], ref bytes[0], ref bytes[0]);
                }
                else if (intESWSecurityLevel == 2)
                {
                    intPtr = NativeMethod.GetProcAddress(hModule, "CalcKeys2");
                    CalcKeys2 calcKeys2 = (CalcKeys2)Marshal.GetDelegateForFunctionPointer(intPtr, typeof(CalcKeys1));
                    calcKeys2(ref requestSeed[0], ref seedKey[0], ref bytes[0], ref bytes[0], ref bytes[0]);
                }
                else if (intESWSecurityLevel == 3)
                {
                    intPtr = NativeMethod.GetProcAddress(hModule, "CalcKeys3");
                    CalcKeys3 calcKeys3 = (CalcKeys3)Marshal.GetDelegateForFunctionPointer(intPtr, typeof(CalcKeys1));
                    calcKeys3(ref requestSeed[0], ref seedKey[0], ref bytes[0], ref bytes[0], ref bytes[0]);
                }
                else
                {
                }
            }

            else if (dlltype == 3)
            {
                intPtr = NativeMethod.GetProcAddress(hModule, "CalcKeys");
                CalcKeys calcKeys = (CalcKeys)Marshal.GetDelegateForFunctionPointer(intPtr, typeof(CalcKeys));
                calcKeys(ref requestSeed[0], ref seedKey[0], ref bytes[0], ref bytes[0], ref bytes[0]);
            }

            else if (dlltype == 4)
            {
                intPtr = NativeMethod.GetProcAddress(hModule, "CalcKeys1");
                CalcKeys1 calcKeys1 = (CalcKeys1)Marshal.GetDelegateForFunctionPointer(intPtr, typeof(CalcKeys1));
                calcKeys1(ref requestSeed[0], ref seedKey[0], ref bytes[0], ref bytes[0], ref bytes[0]);
            }

            NativeMethod.FreeLibrary(hModule);
            return(seedKey);
        }