Get the IP Address of a local machine Using C#

The function below retrieves the IP address of a local machine using C#. This sample code uses the system.NET namespace to get the host name and then gets the IP address for that host name. C# private string GetIPAddress() { StringBuilder sb = new StringBuilder(); String strHostName = string.Empty; strHostName = Dns.GetHostName(); sb.Append("The Local Machine... » read more

Check for Even or Odd Number Using C#

This program checks whether a number entered in a textbox is an Even or Odd number. In math, a number who can be divided by 2 with a zero reminder Is an Even number. If a number is not divided by 2 then that number is indeed an odd number. This function is frankly easy... » read more

Calculate Average of Numbers in Arrays using C++

The sample code below is to demonstrate how to calculate the average of integer numbers in an array using C++. It’s a console application that takes the ‘n’ as an argument, which is the number of element to be stored in an array, then calculates the average of those numbers. How does this program work?... » read more

Create a Simple Thread Program Using C#

This sample code will teach you the basic of creating a thread in C#. The console app that we are about to create will a new ThreatStart delegate that will point to a method which will be executed by the thread. The delegate will be passed as a parameter whenever a new thread instance is... » read more

Introduction to File handling methods in VB.NET

In this article I will shed some light on the most used methods in VB.NET for file handling. File handling is important when it comes to storing and retrieving data using the file system. These functions and methods are in the IO namespace: System.IO Different and most used methods for handling file in VB.NET are... » read more

Introduction to Numeric Functions in vb.net

The .NET Framework has too many numeric functions that can be used out of the box for numeric manipulation. This article is to learn about the most common ones that each developer should know.   The Numeric Functions in VB.NET  All numeric functions that are available VB.NET are implemented as the constant and static methods of Math... » read more

Different date conversion from string to date in C#

In the article, we will learn about various date conversion method that converts date type String to data type date. To better understand this tutorial, you should be knowledgeable in  following C# programming topic: C# if statement Sting to Date conversion is one of the most used transformations in software development. For some reasons, software developers... » read more

How to get hidden field value using JavaScript

Here are the two ways to get a hidden filed value using JavaScript: document.getElementById(‘Id of the hidden field).value document.formName.elements[‘name of the hidden field].value You can use the way you prefer; both will return the same value. And here is an example: JavaScript: <script type="text/javascript"> function GetHiddenFieldValue(){ var HiddenFiledID; var HiddenFiledName; HiddenFiledID = document.getElementById(hfID).value; HiddenFiledName =... » read more

Introduction to Dictionary Initializer in C#

Dictionary Initializer got introduced in Visual Studio 2015, .NET 4.6 and C#6.0. With its use, we were able to map indexer during the initialization of the dictionary object. Let us now look in the fact of how this could be used complete elaboration. To better understand this tutorial, you should know following C# programming topic:... » read more

Introduction to iterator in C# and VB.NET

In this article, I will discuss the type of iterators that are supported by C# and VB.NET. .NET Framework usually supports two different kinds of the iterator: External and Internal External iterator: It is the statement where we should specify every single step for completing the task. You can consider the below code: C# List<string>... » read more

Creating Repository pattern in ASP.net MVC

In this article, I will help you to understand how to create a Repository Pattern that is mainly used for large enterprise application. The Repository pattern divides the application’s UI, components of data access and business logic into several layers which are easy to test and maintain. A Employees application will be created which will... » read more