引擎初始化在IIS上返回错误,但在localHost上完全正确

本文关键字:但在 localHost 完全正确 错误 返回 初始化 IIS 引擎 | 更新日期: 2023-09-27 18:29:43

我一直在为SecurSearch SDK pro创建web服务,这些服务在本地运行得非常好但其引擎无法在IIS上初始化。它正在读取位于C:''…上的许可证文件。出于检查目的,我已经阅读了.dalience文件,它的读取也正确。

    [WebMethod]
   public void init()
   {
       Int32 iError = 0;
       SS_EngineParam pEngineParam;
       pEngineParam = new SS_EngineParam();
       pEngineParam.CandidateNumber = m_NumCandList;
       pEngineParam.MemPoolSizeMB = SIZE_MEMORY_POOL;
       //pEngineParam.szLicenseFile = SECUSEARCH_LICENSE_FILE;
       string text = System.IO.File.ReadAllText(@"C:''Program Files (x86)''SecuGen''SecuSearch SDK Pro''License''temp_license.dat");
       // Display the file contents to the console. Variable text is a string.
       System.Console.WriteLine("Contents of WriteText.txt = {0}", text);
       if (IsWow64())
           pEngineParam.szLicenseFile = SECUSEARCH_LICENSE_FILE_x64;
       else
           pEngineParam.szLicenseFile = SECUSEARCH_LICENSE_FILE;
       // Initialize SecuSearch Engine.
       m_SecuSearch = new SecuSearch();
       iError = m_SecuSearch.InitializeEngine(pEngineParam);// here it returns an error 2006
       if (iError == (Int32)SS_Error.ERROR_NONE)
       {
           OracleConnection con = new OracleConnection();
           string oradb = "Data Source=localhost;Persist Security Info=True;User ID=.....;Password=.....";
           con.ConnectionString = oradb;
           con.Open();
           String strCommmand = "SELECT user_id, finger_no, sample_no, template_b64encoded FROM ForFDxSample";
           OracleCommand cmd = new OracleCommand(strCommmand, con);
           cmd.CommandType = CommandType.Text;
           string x;
           OracleDataReader objDataReader = null;
           try
           {
               objDataReader = cmd.ExecuteReader();
               if (objDataReader.HasRows)
               {
                   while (objDataReader.Read())
                   {
                       SS_IDInfo idInfo;
                       idInfo = new SS_IDInfo();
                       idInfo.ID = Convert.ToInt32(objDataReader[0]);
                       //       idInfo.FingerNumber = Convert.ToByte(objDataReader[1]);
                       idInfo.SampleNumber = Convert.ToByte(objDataReader[2]);
                       String template = objDataReader[3].ToString();
                       Byte[] minData;
                       minData = Convert.FromBase64String(template);
                        iError = m_SecuSearch.RegisterFP(minData, idInfo);

                   }
               }
           }
           catch (OracleException err)
           {
               String Text = err.ToString();
           }
           objDataReader.Close();
           cmd.Dispose();
           con.Close();
       }
   }

这是init代码。

i错误=m_SecurSearch.InitializeEngine(pEngineParam);//这里它返回一个错误2006

我正在使用MVC2

引擎初始化在IIS上返回错误,但在localHost上完全正确

已解决。

  1. 我必须转到本地安全策略->下的"用户权限分配"安全设置
  2. 选择"锁定内存中的页面"并打开属性
  3. 添加用户IIS_IUSRS
相关文章: