15/06/2015 by Nitesh

Getting Started With HTML Agility Pack

Friends, In this post we will see how to get started with HTML Agility Pack and code samples to see how web scraping can be achieved using this package in C#. For users who are unaware about “HTML Agility Pack“, This is an agile HTML parser that builds a read/write DOM and supports plain XPATH…

Continue Reading »

06/06/2015 by Nitesh

How To Count Occurrences of a String Within Another String in C#

Friends, In programming while performing some business logic validations, many times we need to find a text within another text. In this post, we will see how can we count occurrences of a string within another string in C#. static void CountOccurenceswWithinString() {    string test = “Hello, how are youyou you you you, you…

Continue Reading »

05/06/2015 by Nitesh

How To Get Public IP Address Using C#

Friends, In this post, we will see how can we get public IP Address of a computer using C#. We will make use of WebRequest class to make a call to the server that returns the IP address of the machine that made the request. Here’s the code snippet that does this – static string…

Continue Reading »

04/06/2015 by Nitesh

How To Sort A Dictionary Object by Values in C#

Friends, Microsoft .Net provides us with classes like SortedDictionary that allows the elements of a Dictionary class to be sorted by Keys. However, in some scenarios we want the Dictionary elements to be sorted by the values present in each element. Today, in this post we will see how can we sort a Dictionary Object…

Continue Reading »

03/06/2015 by Nitesh

How To Return Multiple Values From Function in C#

Friends, We all know Functions in C# has a function signature, function body and a return type. The signature comprises of the parameters sent to the function, Function body is the lines of code executed when the function is called and the Return Type is the type of value returned to the calling function. However,…

Continue Reading »

1 2 3 4 10