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
30
Jul
2014

javascript Request object interface Request.Cookies.Set Request.Cookies.Get Request.Cookies.Clear Request.QueryString.Get Source Code var Request = { Cookies: { Set: function (cookie_name, cookie_value, expires_in_days) { try { var cookie_full_value = escape(cookie_value); if (expires_in_days != null) { var exdate = new Date(); exdate.setDate(exdate.getDate() + expires_in_days); cookie_full_value += '; expires=' + exdate.toUTCString(); } document.cookie = cookie_name + '=' + cookie_full_value; } catch (e) { } }, Get: function (cookie_name) { var i, x, y, ARRcookies = document.cookie.split(';'); for (i = 0; i <.

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

Regular Expressions in javascript

Posted by: RcBuilder  /   Category: JAVASCRIPT / Regular Expressions / Validators   /   2 Comments
17
Jun
2014

Regular Expressions in javascript example1 var input = 'aaa bbb RcBuilder ccc ddd'; var pattern = 'Rcbuilder'; var regex = new RegExp(pattern, 'i'); // i = ignore case var isMatch = regex.test(input); // isMatch = true alert(isMatch); example2 var input = document.location; var pattern = 'index.htm'; var regex = new RegExp(pattern, 'i'); // i = ignore case var isMatch =.

Read more

HttpWebRequest with proxy

Posted by: RcBuilder  /   Category: Network / Regular Expressions / SOURCE CODE / Stream / WebRequest   /   No Comments
22
May
2014

using the HttpWebRequest to perform requests via proxy servers USING HttpStatusCode STATUS; string res = Helper.GET("http://noc.co.il/", string.Empty, "187.84.187.8:80", 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() ------ public static string GET(string url, string vars, string Proxy, out HttpStatusCode STATUS) { try { STATUS = HttpStatusCode.OK; if (vars != string.Empty) { if (!vars.StartsWith("?")) vars = "?" + vars; url =.

Read more

asp net phone validator

Posted by: RcBuilder  /   Category: Regular Expressions / SOURCE CODE / Validators   /   1 Comment
11
May
2014

asp.net phone validator <asp:RequiredFieldValidator runat="server" ControlToValidate="txtPhone" Display="Dynamic" Text="Necessary" /> <asp:RegularExpressionValidator runat="server" ControlToValidate="txtPhone" Display="Dynamic" Text="Incorrect Phone" ValidationExpression="\+?+".

Read more

replace using match groups

Posted by: RcBuilder  /   Category: Rad Software / Regular Expressions   /   No Comments
08
May
2014

Rad Software - replace using match groups use (?<YourGroupName>.*?) to create match group in the regular expression clause use ${YourGroupName} to use group value in replace clause Regular expression : (?<g1>.*?)@TRADINGCRM.com Replace Expression : ${g1}@leaderdns.com Rad Software.

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