
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Karthikeya Boyini has Published 2193 Articles

karthikeya Boyini
3K+ Views
Decimal type has constants to get the minimum and maximum values.Set a decimal value −decimal d = 5.8M;To get the minimum and maximum values of the decimal type, use the following properties −decimal.MaxValue decimal.MinValueHere is the complete code −Example Live Demousing System; using System.Linq; class Demo { static void Main() ... Read More

karthikeya Boyini
2K+ Views
To get the last write time of a file in C#, use the LastWriteTime() method.For this, use the FileInfo as well as DateTime classes.Create an object of each −FileInfo file = new FileInfo("amit.txt"); DateTime dt = file.CreationTime; dt = file.LastWriteTime;Let us see the complete code −Example Live Demousing System.IO; using System; ... Read More

karthikeya Boyini
2K+ Views
To get the creation time of a file in C#, use the CreationTime() method.For this, use the FileInfo as well as DateTime classes.Create an object of each −FileInfo file = new FileInfo("new.txt"); DateTime dt = file.CreationTime;Let us see the complete code −Example Live Demousing System.IO; using System; public class Program { ... Read More

karthikeya Boyini
431 Views
To specify number types, use suffixes in C#. Literal number suffixes are numeric suffixes.For example, for long type −// long suffix long val1 = 29345L;For double type −// double suffix double val2 = 297.325D; Console.WriteLine(val2);Let us see more examples −Example Live Demousing System.IO; using System; public class Program { public ... Read More

karthikeya Boyini
3K+ Views
If you want to skip a number of elements in an array, then use the Skip() method in C#.Let’s say the following is our array −int[] arr = { 24, 40, 55, 62, 70, 82, 89, 93, 98 };Now to skip first four elements −var ele = arr.Skip(4);Let us see ... Read More

karthikeya Boyini
617 Views
Declare an array −int[] arr = { 10, 90, 20, 19, 99, 57 };Now to get the largest element from an array, use Max() method with lambda expressions −arr.Max());Here is the complete code −Example Live Demousing System; using System.Linq; class Demo { static void Main() { int[] ... Read More

karthikeya Boyini
868 Views
Firstly, set the Dictionaries to be combined −Dictionary dict1 = new Dictionary (); dict1.Add("one", 1); dict1.Add("Two", 2); Dictionary dict2 = new Dictionary (); dict2.Add("Three", 3); dict2.Add("Four", 4);Now, use HashSet to combine them. The method used for the same purpose is UnionWith() −HashSet hSet = new ... Read More

karthikeya Boyini
2K+ Views
Firstly, create a file using StreamWriter class and add content to it −using (StreamWriter sw = new StreamWriter("hello.txt")) { sw.WriteLine("This is demo line 1"); sw.WriteLine("This is demo line 2"); sw.WriteLine("This is demo line 3"); }Now use the ReadAllLines() method to read all the lines. With that, the ... Read More

karthikeya Boyini
280 Views
Use the Directory. Exists method to check whether a directory exists or not.Let’s say you need to check whether the following directory exists or not −C:\AmitFor that, use the Exists() method −if (Directory.Exists("C:\Amit")) { Console.WriteLine("Directory Amit Exist!"); }The following is the complete code −Example Live Demousing System.IO; using System; public ... Read More

karthikeya Boyini
168 Views
Use the CreateDirectory method to create a directory.Let’s say you need to create a directory in D drive. For that, use the CreateDirectory() method as shown below −Directory.CreateDirectory("D:\Tutorial");The following is the code −Exampleusing System.IO; using System; public class Program { public static void Main() { Directory.CreateDirectory("D:\Tutorial"); ... Read More