Abundant Code

  • C#
  • C++
  • Elastic Search
  • Entity Framework
  • F#
  • JavaScript
  • ASP.NET
  • C
  • Java
  • SQL Server
  • Assembly Lang
Home » dotnet

Initialize int array in C# ?

October 6, 2016 by AbundantCode Leave a Comment

Here’s a code snippet demonstrating how to initialize int arrays in C# and display the contents of it using the for loop.

How to Initialize int array in C# ?

using System;

namespace ACConsoleApp1
{
    class Program
    {
        static void 
…

Filed Under: C# Tagged With: csharp, dotnet, How to

How to get the IP Address of the Local Machine using C# ?

July 18, 2015 by AbundantCode Leave a Comment

You can get the IP address of the local machine or localhost using C# using the Dns class’s GetHostByName defined in the System.Net namespace.

The Dns.GetHostByName returns the array of AddressList which contains the IP address .

How to get

…

Filed Under: NETWORK Tagged With: csharp, dotnet, How to, IP address, tutorials

How to sort an array using Comparator in C# ?

July 9, 2015 by AbundantCode Leave a Comment

The Array.Sort method lets the developers pass the comparator which can be used to sort an array of objects.

How to sort an array using Comparator in C# ?

In the below example , the method CompareByName is used …

Filed Under: C# Tagged With: csharp, dotnet, How to, tips, tricks

How to Compare two arrays in C# ?

July 6, 2015 by AbundantCode Leave a Comment

Two arrays can be compared in C# using the Enumerable.SequenceEqual method . The Enumerable.SequenceEqual method in C# returns a boolean value indicating if both the arrays are equal or not.

How to Compare two arrays in C# ?

Below is …

Filed Under: C# Tagged With: Array, compare, csharp, dotnet

How to find if the string is a number or not in C# ?

June 8, 2015 by AbundantCode Leave a Comment

If you want to find out if the input string is a number in C# , you can use the try parse method.

How to find if the string is a number or not in C# ?

Below is a …

Filed Under: C# Tagged With: csharp, dotnet, How to, numeric

How to Copy the entire contents of a directory in C# ?

May 25, 2015 by AbundantCode Leave a Comment

Below is a sample code snippets that demonstrates how to copy the entire contents of a directory to another in C#.

How to Copy the entire contents of a directory in C# ?

using System;
using System.IO;

namespace AbundantCodeConsoleApp
{
    
…

Filed Under: C# Tagged With: csharp, Directory, dotnet, File, tips, tricks

How to Save a Stream to a File in C# ?

April 22, 2015 by AbundantCode Leave a Comment

Below is a sample code snippet that demonstrates how to save a stream to a file in C#.

How to Save a Stream to a File in C# ?

using (var fileStream = File.Create("E:\\FilePath.txt")) 
{ 
    Object1.InputStream.Seek(0, SeekOrigin.Begin); 
    Object1.InputStream.CopyTo(fileStream); 
}
…

Filed Under: C# Tagged With: csharp, dotnet, tips, tricks

Using String.Format method in C# to add commas in thousands place for a Number

April 15, 2015 by AbundantCode Leave a Comment

If you need to add a comma in the thousands place for a number using the String.Format method in C# , you can use the format specifier N as shown in the below code snippet.

Using String.Format method in C#

…

Filed Under: C# Tagged With: csharp, dotnet

C#.NET Interview Questions and Answers – Part 3

April 7, 2015 by AbundantCode Leave a Comment

C#.NET Interview Questions and Answers – Part 3

21. What is the use of Nan values for double and float in C# ?

Nan in C# is generally used to represent special values in .NET . For example , in …

Filed Under: Interview Questions Tagged With: csharp, dotnet, interview questions and answers

RSS
Facebook
fb-share-icon
Twitter
Visit Us
Follow Me
Tweet

Recent Posts

  • InvalidModuleDescriptorException when running java program in Eclipse IDE
  • Python Program to Check Armstrong Number
  • Collapsible links for subcategories in Docusaurus Sidebar
  • Python Program to Print Fibonacci Series
  • Python Program to Generate Multiplication Table

Categories

Tags

.NET App Array ASP.NET ASP.NET MVC Assembly Language C# C# programs c lab programs Collection convert C program csharp database Example F# guide How to How to in Java integer Java Javascript Lab programs Lambda LINQ List Python lab programs Python programs SIC/XE SQL Server string tips tricks tutorial tutorials UWP visual studio 2015 Windows Windows 8 Windows 10 Windows Phone Windows Phone 8 Windows Phone 8.1 wp8 XAML

Blog Stats

  • 8,746,874 hits

Archives

Top Posts & Pages

  • How to Convert a Stream to Byte Array in C# 4.0 ?
  • How to Quickly Delete All Rows in a Table in Entity Framework?
  • How to Allow only numeric input in a Textbox in WPF ?
  • How to retrieve the URL of the current Page in ASP.NET MVC 4 Controller ?
  • How to open display settings from command line in Windows 10 ?
  • How to clean up unused PowerPoint master slides in PowerPoint?
  • How to Calculate MD5 checksum for a file in C# ?
  • C Program to display half-pyramid using alphabets
  • How to Extract number from a string using C# ?
  • How to get the Relative Server Path in ASP.NET Web API ?

Categories

  • Android
  • Angular 2
  • ASP.NET
  • Assembly Language
  • C
  • C#
  • C++
  • Elastic Search
  • Entity Framework
  • Excel
  • F#
  • HTML
  • Interview Questions
  • Java
  • JavaScript
  • jQuery
  • Microsoft Office
  • MySQL
  • NETWORK
  • News
  • PHP
  • popular
  • PowerShell
  • Python
  • Ruby
  • SharePoint
  • SQL Server
  • SQL Server
  • Unix
  • VB.NET
  • Visual Studio
  • WebAPI
  • Windows
  • Windows Azure
  • Windows Forms
  • XAML

Top Posts & Pages

  • How to Convert a Stream to Byte Array in C# 4.0 ?
  • How to Quickly Delete All Rows in a Table in Entity Framework?
  • How to Allow only numeric input in a Textbox in WPF ?
  • How to retrieve the URL of the current Page in ASP.NET MVC 4 Controller ?
  • How to open display settings from command line in Windows 10 ?
  • How to clean up unused PowerPoint master slides in PowerPoint?
  • How to Calculate MD5 checksum for a file in C# ?
  • C Program to display half-pyramid using alphabets
  • How to Extract number from a string using C# ?
  • How to get the Relative Server Path in ASP.NET Web API ?

Recent Posts

  • InvalidModuleDescriptorException when running java program in Eclipse IDE
  • Python Program to Check Armstrong Number
  • Collapsible links for subcategories in Docusaurus Sidebar
  • Python Program to Print Fibonacci Series
  • Python Program to Generate Multiplication Table
  • Python Program to Find the Factorial of a Number
  • Python Program to Print Prime Numbers in a Given Interval
  • Python Program to Check Prime Number
  • Python Program to Find the Largest Value Among Three Numbers
  • Python Program to Check If a Given Year is Leap Year

Tags

.NET App Array ASP.NET ASP.NET MVC Assembly Language C# C# programs c lab programs Collection convert C program csharp database Example F# guide How to How to in Java integer Java Javascript Lab programs Lambda LINQ List Python lab programs Python programs SIC/XE SQL Server string tips tricks tutorial tutorials UWP visual studio 2015 Windows Windows 8 Windows 10 Windows Phone Windows Phone 8 Windows Phone 8.1 wp8 XAML