Get local IP address list using C#

Use the Static method Dns.GetHostAddresses to get a list of computer IP Addresses. First, you need to to get the Computer name. Then pass it as a parameter to the Dns.GetHostAddresses method. Required Namespace: System.Net C# String ComputerName= Dns.GetHostName(); IPAddresses[] localIPs = Dns.GetHostAddresses(ComputerName);

Get words count in a string using VB.NET

Below is a simple function that takes one string argument and returns the word count in that string. In this function, we will use the following VB.NET built-in function: UBound: a function that returns the highest subscript for the indicated dimension of an array. Split: a function that splits strings. It extracts the substrings from... » read more

Create an Auto-complete ComboBox using VB.NET

This tutorial will teach you how to create an auto-complete ComboBox in a WinForm application. Auto-complete ComboBox is very useful when there are too many items in it. Auto-complete ComboBox using VB.NET First, we need to create a SQL Server database: Design View Data View Related Auto-Complete ComboBox Using C# Now open visual studio and... » read more

Socket connect and data send using C#

This tutorial will explain how to connect to a host machine, and then send data via TCP Socket. First, we need to add the namespaces: using System.Net; using System.Net.Sockets; And the function: public static void SendData(string data, Int32 port, string ips) { IPAddress host = IPAddress.Parse(ips);// IPEndPoint ipendpoint = new IPEndPoint(host, port); // assign host... » read more

Bind an ADO.NET DataTable to a TreeView using VB.NET

In this example, we will teach you how to bind a TreeView using a DataTable in Vb.NET. First, create a WinForm Project in Visual Studio, Select Vb.NET as the language. Then, add a TreeView control to the main form. DataBase And the Code: VB.NET Sub BindTreeView() Dim connetionString = "Data Source=TutorialsPanel-DB\SQLEXPRESS; Initial Catalog=TutorialsPanel;Integrated Security=True;" Dim... » read more

Bind an ADO.NET DataTable to a ListBox using VB.NET

The example below shows us how to bind a ListBox using vb.NET. The ListBox comes from System.Windows.Controls namespace. It’s a list of items that can be selected. First, create a new Visual Studio Project using VB.NET, then add a list box control to the main form as shown below: For this example we will use... » read more

Function Returns DataTable Using C#

Below is a function that returns a DataTable using in C#. DataTables are derived from the namespace System.Data. We will also use a DataAdapter in this example. The DataAdapter Fills the DataTable from a SQL Database based on a SQL Query which is defined in a SQLCommand. Database C# protected DataTable GetAllRecords() { SqlConnection sqlconn... » read more

Introduction to Microservices

Microservice Architecture: An Incisive Overview Divide and conquer You may know it to be a type of algorithm design paradigm. But: On a basic level, the phrase aptly describes a concept that stems from an evergreen desire in the software industry to build systems by joining several individual components—much like how most industries create things... » read more

Get computer name using C#

To get a computer name in C#, use the property MachineName from the Environment Class: C# strComputerName = Environment.MachineName.ToString(); The Environment class is inherited from the System.Object. It provides information about the current platform and environment of the executable application. Related Articles

Auto-Complete ComboBox Using C#

A combo-box is a window form control that developers use for better user experience. It’s a combination of a dropdown list and a text box. It allows the user to select the desired item or directly type a value into the control. To better understand this tutorial, you should know following C# programming areas:  C#... » read more

An Overview of Object-Oriented Programming in C#

Object-Oriented Programming in a Nutshell The complexity of software is ever growing, with its related issues—large codebases that may be difficult to understand and maintain. Programmers keep the complexity in check using any of a variety of programming styles, technically called programming paradigms. To better understand this tutorial, you should know the following C# programming areas:... » read more

C# Array Tutorial

An array is a data structure that can store a fixes sized collection of elements that belong to the same data type. For example, an array can store a sequence of numbers that starts from 1 to 10. Each item has an index that is represented by a number. For example: arr [0] represents the... » read more