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. OpenGL超级宝典第5版&&glProvokingVertex

    翻译:https://www.opengl.org/sdk/docs/man3/xhtml/glProvokingVertex.xml 方法原型:void glProvokingVertex(GLen ...

  2. Hadoop 学习之 FAQ

    在Hadoop的学习与使用过程中同样如此.这里为大家分享Hadoop集群设置中经常出现的一些问题,以下为译文: 1.Hadoop集群可以运行的3个模式? 单机(本地)模式 伪分布式模式 全分布式模式 ...

  3. redo文件一

    redo log files and redo log buffer redo log files的作用的是确保数据库崩溃之后能正确的恢复数据库,恢复数据库到一,致性的状态 redo log file ...

  4. ExcelUtils 导表实例

    @RequestMapping("/dealer/chargebook/exportv.htm")    public void getChargeBookList(int epm ...

  5. [LeetCode] Ugly Number (A New Question Added Today)

    Write a program to check whether a given number is an ugly number. Ugly numbers are positive numbers ...

  6. How do I use SOCKS proxy in delphi?

    TCP====== For Indy 8.0 In Delphi, do the following: IdTCPClient1.SocksInfo.Host := [the DNS name of ...

  7. jquery validate easyui tooltip

    jquery validate.js onfocusin: function (element, event) { this.lastActive = element; // hide error l ...

  8. #JAVA操作LDAP

    package com.wisdombud.unicom.monitor.ldap; import java.util.ArrayList; import org.slf4j.Logger; impo ...

  9. 使用Jena RDF API 开发脚本语言管理资源描述框架模型

    摘要 资源描述框架(Resource Description Framework RDF)是一种以XML格式描述元数据的标准格式.Jena是一种用于将关系数据库或是文本文件中所表示的数据建立为元数据模 ...

  10. 12 为何使用Html5+CSS3

    一:大多浏览器支持,低版本也没问题 我看点这方面的资料,是为了做手机应用网站(有三个方案,这个是备用方案),可以开发响应式网站,可以脱离开发平台进行跨平台. 在Html5网页中引入Modernizr, ...