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. 数据库连接类oracleHelper

    //=============================================================================== // OracleHelper ba ...

  2. homework-03

    1.分工准备 这次的工作是结对编程,在第二次作业中我是使用python完成的作业,而小明是使用C完成的作业.因为打算使用动态链接库的方式将第二次的代码嵌入到本次的作业中,而python生成动态链接库不 ...

  3. homework-06&homework-09

    homework-06 1) 把程序编译通过, 跑起来 , 把正确的 playPrev(GoMove) 的方法给实现了. public void playPrev(GoMove gm) { // ne ...

  4. log4j2使用总结

    一.Log4j有三个主要的组件:Loggers,Appenders和Layouts,这里可简单理解为日志级别,日志要输出的地方和日志格式 1. Logger Logger的日志级别有6级,分别是TRA ...

  5. 【C语言】-一维数组

    数组: 数组是一系列相同类型的有序数据的集合,数组中的每一个元素都是同一个数据类型,所有元素共用一个名字,用下标来区别数组中的每一个元素. C语言中,数组属于构造数据类型.一个数组中含有多个数组元素, ...

  6. Oracle DB 执行用户管理的备份和恢复

    • 说明用户管理的备份和恢复与服务器管理的备份和恢复 之间的差异 • 执行用户管理的数据库完全恢复 • 执行用户管理的数据库不完全恢复 备份和恢复的使用类型 数据库备份和恢复的类型包括: • 用户管理 ...

  7. Serializable 序列化为字符串 base64

    工具类 Base64.java import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import ja ...

  8. UI进阶 SQLite错误码

    #define SQLITE_OK 0 /* 成功 | Successful result */ /* 错误码开始 */ #define SQLITE_ERROR 1 /* SQL错误 或 丢失数据库 ...

  9. velocity 快速入门

    基本语法      1.变量定义 : $name 注意 : a.名字和$配合一起用  b.更规范的写法是 ${name} 2.赋值 : #set($name = "威少") 3.条 ...

  10. mysql xtarbackup备份脚本

    #!/bin/sh # # # Script config User="user" Password="passwd" Basedir=/application ...