当前位置: 首页>>代码示例>>C++>>正文


C++ IPAddressSQLHelper::GetAddress2Equals方法代码示例

本文整理汇总了C++中IPAddressSQLHelper::GetAddress2Equals方法的典型用法代码示例。如果您正苦于以下问题:C++ IPAddressSQLHelper::GetAddress2Equals方法的具体用法?C++ IPAddressSQLHelper::GetAddress2Equals怎么用?C++ IPAddressSQLHelper::GetAddress2Equals使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IPAddressSQLHelper的用法示例。


在下文中一共展示了IPAddressSQLHelper::GetAddress2Equals方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: Instance

   bool 
   PersistentLogonFailure::ClearFailuresByIP(const IPAddress &ipaddress)
   {
      IPAddressSQLHelper helper;

      String whereClause;
      whereClause.Format(_T("ipaddress1 %s and ipaddress2 %s"), 
         String(helper.GetAddress1Equals(ipaddress)),
         String(helper.GetAddress2Equals(ipaddress)));

      SQLStatement statement;
      statement.SetStatementType(SQLStatement::STDelete);
      statement.SetWhereClause(whereClause);
      statement.SetTable("hm_logon_failures");

      return Application::Instance()->GetDBManager()->Execute(statement);
   }
开发者ID:Bill48105,项目名称:hmailserver,代码行数:17,代码来源:PersistentLogonFailure.cpp

示例2: command

   shared_ptr<GreyListTriplet> 
   PersistentGreyList::GetRecord(const String &sSenderAddress, const String &sRecipientAddress, const IPAddress & remoteIP)
   //---------------------------------------------------------------------------()
   // DESCRIPTION:
   // Returns a grey list triple based on sender, recipient and IP address.
   //---------------------------------------------------------------------------()
   {
      shared_ptr<GreyListTriplet> pTriplet;

      IPAddressSQLHelper helper;

      String sSQL;
      sSQL.Format(_T("select * from hm_greylisting_triplets where glipaddress1 %s and glipaddress2 %s and glsenderaddress = @SENDERADDRESS and glrecipientaddress = @RECIPIENTADDRESS"), 
            String(helper.GetAddress1Equals(remoteIP)),
            String(helper.GetAddress2Equals(remoteIP)));

      SQLCommand command(sSQL);
      command.AddParameter("@SENDERADDRESS", sSenderAddress);
      command.AddParameter("@RECIPIENTADDRESS", sRecipientAddress);

      shared_ptr<DALRecordset> pRS = Application::Instance()->GetDBManager()->OpenRecordset(command);
      if (!pRS || pRS->IsEOF())
      {
         // Not found
         return pTriplet;
      }

      // Read the record.
      pTriplet = shared_ptr<GreyListTriplet>(new GreyListTriplet);
      pTriplet->SetID(pRS->GetInt64Value("glid"));
      pTriplet->SetCreateTime(pRS->GetStringValue("glcreatetime"));
      pTriplet->SetBlockEndTime(pRS->GetStringValue("glblockendtime"));
      pTriplet->SetDeleteTime(pRS->GetStringValue("gldeletetime"));
      
      pTriplet->SetIPAddress(IPAddress(pRS->GetInt64Value("glipaddress1"), pRS->GetInt64Value("glipaddress2")));
      pTriplet->SetSenderAddress(pRS->GetStringValue("glsenderaddress"));
      pTriplet->SetRecipientAddress(pRS->GetStringValue("glrecipientaddress"));

      pTriplet->SetPassedCount(pRS->GetLongValue("glpassedcount"));
      pTriplet->SetBlockedCount(pRS->GetLongValue("glblockedcount"));

      return pTriplet;
   }
开发者ID:jrallo,项目名称:hMailServer,代码行数:43,代码来源:PersistentGreyList.cpp

示例3: command

   int 
   PersistentLogonFailure::GetCurrrentFailureCount(const IPAddress &ipaddress)
   {
      IPAddressSQLHelper helper;

      String sql;
      sql.Format(_T("select count(*) as c from hm_logon_failures where ipaddress1 %s and ipaddress2 %s"), 
         String(helper.GetAddress1Equals(ipaddress)),
         String(helper.GetAddress2Equals(ipaddress)));

      SQLCommand command(sql);

      shared_ptr<DALRecordset> pRS = Application::Instance()->GetDBManager()->OpenRecordset(command);
      if (!pRS)
         return 0;

      long count = pRS->GetLongValue("c");

      return count;
   }
开发者ID:Bill48105,项目名称:hmailserver,代码行数:20,代码来源:PersistentLogonFailure.cpp


注:本文中的IPAddressSQLHelper::GetAddress2Equals方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。