It is at WebWorkContext.CurrentCustomer's part.

                //check whether request is made by a search engine
//in this case return built-in customer record for search engines
//or comment the following two lines of code in order to disable this functionality
if (customer == null || customer.Deleted || !customer.Active)
{
if (_userAgentHelper.IsSearchEngine())
customer = _customerService.GetCustomerBySystemName(SystemCustomerNames.SearchEngine);
} and to _userAgentHelper.IsSearchEngine() /// <summary>
/// Get a value indicating whether the request is made by search engine (web crawler)
/// </summary>
/// <returns>Result</returns>
public virtual bool IsSearchEngine()
{
if (_httpContext == null)
return false; //we put required logic in try-catch block
//more info: http://www.nopcommerce.com/boards/t/17711/unhandled-exception-request-is-not-available-in-this-context.aspx (I checked this page, but the url is not valid now) bool result = false;
try
{
var uasParser = GetUasParser();
var userAgent = _httpContext.Request.UserAgent;
result = uasParser.IsBot(userAgent);
//result = context.Request.Browser.Crawler;
}
catch (Exception exc)
{
Debug.WriteLine(exc);
}
return result;
} and to var uasParser = GetUasParser(); protected virtual UasParser GetUasParser()
{
if (Singleton<UasParser>.Instance == null)
{
//no database created
if (String.IsNullOrEmpty(_config.UserAgentStringsPath))
//UNDONE: maybe, throw an exception?
return null; var filePath = _webHelper.MapPath(_config.UserAgentStringsPath);
var uasParser = new UasParser(filePath);
Singleton<UasParser>.Instance = uasParser;
}
return Singleton<UasParser>.Instance;
}

This library is used to parse information about user agents located at \App_Data\uas_20140809-02.ini file. Both of them (DLL and INI files) were downloaded at http://user-agent-string.info (was available for free). Now I see that this project is moved to https://udger.com/ on November 2014 with sone new pricing options. I've jusy contacted them trying to understand whether we can continue usage of the new project (still looking forward for reply)

这个库是用来解析用户代理信息 位于\ App_Data \ uas_20140809-02。ini文件。(DLL和INI文件)在http://user-agent-string.info下载(免费)。

我看到这个项目转到https://udger.com/在2014年11月重新的定价方案。我jusy联系他们试图了解我们是否可以继续使用新项目(仍然期待回复)

http://blog.csdn.net/defonds/article/details/8128165

UserAgentStringLibrary的更多相关文章

  1. Autofac

    程序集准备 Assembly: Autofac/Autofac.Integration.Mvc/System.Web.Mvc/System.Web.Helpers/System.Web.WebPage ...

  2. 类型查找器 ITypeFinder

    NopCommerce为了支持插件功能,以及支持一些自动注册的功能.系统提供了类型查找器.ITypeFinder以及实现类就是提供此功能.通过类型查找器可以查找本程序域中的类,也可以查找整个bin目录 ...

随机推荐

  1. LoadRunner检查点实战

    码农博客 即将到期,现将博客中部分文章转载到博客园.转载时略有删减. 一.为什么要使用检查点 为什么要使用检查点,那就要说明一下LR如何判断脚本是否执行成功. LR判断脚本是否执行成功是根据服务器返回 ...

  2. 提取数字、英文、中文、过滤重复字符等SQL函数(含判断字段是否有中文)

    --SQL 判断字段值是否有中文 create  function  fun_getCN(@str  nvarchar(4000))    returns  nvarchar(4000)      a ...

  3. 如何在 Windows Azure 的虚拟机 ubuntu 上面安装和配置 openVPN(三)

    第三步:安装openVPN 请打开 ubuntu 官方文档.然后,从上到下,按照步骤,输入执行命令.大家只需要执行到 First trouble shooting 之前即可. 不要怕麻烦,仔细读,一步 ...

  4. Windows Azure 不能ping通的解决方案

    Windows Azure 不能ping通如何解决? 为了避免Ping Flood攻击,Windows Azure不开放对外ICMP通讯协定,所以使用ping命令我们是无法ping通的.在微软资料中心 ...

  5. <Chapter 2>2-2.开发应用(developing the Application)

    一个App Engine应用对网络请求做出响应.它是通过调用请求处理器(quest handlers)来实现的,接受请求参数并返回响应的程序.对于来自请求URL上的请求,App Engine通过一个配 ...

  6. 更换Oracle备份数据文件

    应用背景:需要查看和修改一下Interlib中的数据,所以要反复的将备份数据进行导入和清空.整理一下步骤 删除tablespace drop tablespace interlib including ...

  7. Java中快如闪电的线程间通讯

    这个故事源自一个很简单的想法:创建一个对开发人员友好的.简单轻量的线程间通讯框架,完全不用锁.同步器.信号量.等待和通知,在Java里开发一个轻量.无锁的线程内通讯框架:并且也没有队列.消息.事件或任 ...

  8. Java多线程编程之同步器

    同步器 为每种特定的同步问题提供了解决方案 Semaphore Semaphore[信号标:旗语],通过计数器控制对共享资源的访问. 测试类: package concurrent; import c ...

  9. ORM 是一种讨厌的反模式

    本文由码农网 – 孙腾浩原创翻译,转载请看清文末的转载要求,欢迎参与我们的付费投稿计划! (“Too Long; Didn’t Read.”太长不想看,可以看这段摘要 )ORM是一种讨厌的反模式,违背 ...

  10. 第二百九十四天 how can I 坚持

    这是怎么了,好难受,晚上都没吃饭,全身都疼.该咋办. 其实,真的是身体最重要. 洗洗睡了.好难受.