RcBuilder@walla.com
call centre: 054-5614020

GetBrowser C#

Posted by: RcBuilder  /   Category: Regex / Regular Expressions / SOURCE CODE   /   No Comments
05
Oct
2014

GetBrowser C# public static string GetBrowser(System.Web.HttpContext context) { string agent = context.Request.UserAgent; if (agent.Contains("MSIE")) { var match = Regex.Match(agent, "MSIE \\s{1} (?<ver>\\d+\\.\\d+)", RegexOptions.IgnorePatternWhitespace | RegexOptions.IgnoreCase); if(match == null || match.Groups == null) return "Internet Explorer"; return string.Concat("Internet Explorer", " ", match.Groups.Value); } if (agent.Contains("Chrome")) return "Chrome"; if (agent.Contains("Safari")) return "Safari"; if (agent.Contains("Opera")) return "Opera"; if (agent.Contains("Firefox")) return "FireFox"; return.

Read more

Regex noc.co.il my ip

Posted by: RcBuilder  /   Category: Regex / Regular Expressions / SOURCE CODE / Stream / WebRequest   /   No Comments
07
Jul
2014

HttpStatusCode STATUS; // need to implement - method that executes http web request to the supplied url - return the site html source string res = Helper.GET("http://noc.co.il/", string.Empty, out STATUS); var ip = Regex.Match(res, @"<b>Your \s+ IP \s+ address \s+ is: \s+ (?<address>\d+\.\d+\.\d+\.\d+)</b>", RegexOptions.IgnoreCase | RegexOptions.IgnorePatternWhitespace).Groups.Value.Trim(); Console.WriteLine("STATUS = " + STATUS + " IP = " +.

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