RcBuilder@walla.com
call centre: 054-5614020

TPL – C# Task Parallel Library

Posted by: RcBuilder  /   Category: Multi Threads / Parallelism / SOURCE CODE / TPL   /   No Comments
26
Jan
2016

TPL - C# Task Parallel Library advantages: 1. heavy actions do not stuck the UI due to the using of another thread and maybe even a different core a good example for this phenomenon is when working with winForms and perform an heavy task - the UI is not responsive 2. an abstraction that built on top of the.

Read more

custom DataTable

Posted by: RcBuilder  /   Category: abstract / ADO.NET / DataColumn / DataRow / DataTable / DefaultView / Entities / Generic T / inheritance / OOP / SOURCE CODE   /   No Comments
11
Jan
2015

custom DataTable namespace CSCode.DataTables { public abstract class baseDataTable { protected DataTable dataTable; public int RowsCount { get { return this.dataTable.Rows.Count; } } public void Sort(string SortColumn) { var view = this.dataTable.DefaultView; view.Sort = SortColumn; this.dataTable = view.ToTable(); } public void ReplaceString(string ColumnName, string OldValue, string NewValue) { foreach (DataRow row in this.dataTable.Rows) try { row.SetField<string>(ColumnName, row.ToString().Replace(OldValue, NewValue)); } catch { } } public object GetSpecificValue(int RowIndex, string ColumnName) { return this.dataTable.Rows; } public static explicit operator DataTable(baseDataTable me) { return me.dataTable; } public static.

Read more

MSMQ basic example

Posted by: RcBuilder  /   Category: Mail / Message Queuing / MessageQueue / MessageQueue / MSMQ / SOURCE CODE / System   /   No Comments
03
Dec
2014

MSMQ basic example - add 'System.Messaging' namespace - in order to get the ability for object to be serialized into the queue they have to be public with empty constructor - in order to see the queues right click on My Computer -> Manage -> Services And Applications -> Message Queuing -> Private Queues Application namespace TestMSMQ { public class User { public string FName.

Read more

binaryTree implementation example

Posted by: RcBuilder  /   Category: binaryTree / recursion / SOURCE CODE   /   No Comments
27
Nov
2014

binaryTree implementation example binaryTree.cs public class Node { public int value { get; set; } public Node left { get; set; } public Node right { get; set; } } public class Tree { public Node parent { get; set; } public Tree(int value) { parent = new Node() { value = value }; } public void Insert(int value) { Insert(parent, value); } private Node Insert(Node node, int value) { // new node if (node == null) { node.

Read more

override static methods

Posted by: RcBuilder  /   Category: OOP / override / SOURCE CODE / Static   /   No Comments
26
Nov
2014

override static methods // a static method belong to the instance of the type itselt (ChildA, ChildB etc.) public class TEST { public class Base { public static string Fun() { return "Base"; } } public class ChildA : Base{} public class ChildB : Base { public static string Fun() { return "ChildB"; } } } USING string a1 = TEST.ChildA.Fun(); // Base string a2 = TEST.ChildB.Fun(); //.

Read more

WebClient download string

Posted by: RcBuilder  /   Category: FileStream / HttpRequest / SOURCE CODE / Stream / WebClient / WebRequest   /   No Comments
25
Nov
2014

WebClient download string get Http content using WebClient option 1 var json = new WebClient().DownloadString(url); option 2 string url = "......" var request = HttpWebRequest.Create(url); var response = request.GetResponse(); var reader = new StreamReader(response.GetResponseStream()); string jsonText = reader.ReadToEnd(); remark: don't forget to use the 'using'.

Read more

web config mail settings – smtp tag

Posted by: RcBuilder  /   Category: configuration / Mail / MailAddress / MailMessage / Network / smtp / SmtpClient / SOURCE CODE / System.Net.Mail   /   No Comments
17
Nov
2014

web config mail settings - smtp tag we can use the smtp built-in tag to define our outgoing mail server instead of using app keys configuration <system.net> <mailSettings> <smtp from="rcbuilder@gmail.com"> <network host="smtp.gmail.com" password="XXXXX" port="587" userName="somemail@domain.com"/> </smtp> </mailSettings> </system.net> using using System.Net.Mail; MailMessage myMessage = new MailMessage(); myMessage.To.Add(new MailAddress("somemail@domain.com", "ROBY")); myMessage.Subject = "HELLO ROBY"; myMessage.Body = "TEXT TEXT TEXT TEXT TEXT TEXT TEXT"; myMessage.IsBodyHtml = true; SmtpClient mySmtp = new SmtpClient(); mySmtp.EnableSsl =.

Read more

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

render-blocks displayed not correctly

Posted by: RcBuilder  /   Category: BUGS / HTML / meta / Render Block / SEO / SOURCE CODE   /   No Comments
16
Nov
2014

render-blocks displayed not correctly Bug: render-blocks displayed not correctly example: public string PageDescription = string.Empty; public string PageKeywords = string.Empty; <head runat="server"> <meta name="keywords" content="<%=this.PageKeywords%>" /> <meta name="description" content="<%=this.PageDescription%>" /> </head> result: <head> <meta name="keywords" content="&lt;%=this.PageKeywords%>" /> <meta name="description" content="&lt;%=this.PageDescription%>" /> </head> fix: just remove the runat="server" from the head.

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