RcBuilder@walla.com
call centre: 054-5614020

Is Search Engine Bot

Posted by: RcBuilder  /   Category: HttpContext / HttpRequest / List / Reference Types / Search Engines / SEO / SOURCE CODE / UserAgent   /   No Comments
16
Nov
2014

Is Search Engine Bot public static bool IsSearchEngineBot(System.Web.HttpContext context) { List<string> robots = new List<string>(); robots.Add("googlebot"); robots.Add("spider"); robots.Add("yahoo"); robots.Add("architext"); robots.Add("baidu"); robots.Add("msnbot"); robots.Add("scooter"); robots.Add("slurp"); robots.Add("teoma"); robots.Add("yandex"); try { string userAgent = context.Request.UserAgent.ToLower(); if(userAgent == string.Empty) return false; foreach (string robot in robots) if (userAgent.Contains(robot)) return true; return false; } catch { return false;.

Read more

implicit cast to return a single instance object

Posted by: RcBuilder  /   Category: Converters / Extensions / implicit / Reference Types / SOURCE CODE   /   No Comments
29
May
2014

using implicit cast to return a single instance object /* the abillity to return a single instance for multiple objects using implicit cast we defined 2 classes (class1 and class2) and we define 2 services (service1 and service2) each service DoWork method should return a different object type (service1 return class1 and service2 return class2) demand: we want to share it.

Read more

ToParams – string extension

Posted by: RcBuilder  /   Category: Dictionary / Extensions / Linq / List / Reference Types / SOURCE CODE   /   1 Comment
28
May
2014

ToParams - string extension ResponseParams public class ResponseParams { private Dictionary<string, string> _prms = null; public ResponseParams() { _prms = new Dictionary<string, string>(); } public ResponseParams(IEnumerable<KeyValuePair<string, string>> prms) : this() { foreach (var p in prms) _prms = p.Value; } public string this { get { return _prms; } set { if (!_prms.ContainsKey(Name)) // new _prms.Add(Name, value); else // update _prms = value; } } } Extensions internal static class Extensions { public static ResponseParams ToParams(this string me){ var res = from.

Read more
  • פיתוח מערכות
  • פתרונות טכנולוגים
  • קידום אתרים
  • בניית אתרים