C# Program to Estimate the Size of a Folder

Ankit kumar
Updated on 21-Apr-2023 14:14:28

515 Views

Introduction In this article, we will understand the C# program to estimate the size of a folder. On our PC, we store files in a directory called a folder. We will also be understanding how to estimate the size of folders that are present inside a file. Calculation of just file size is not enough to reach our goal. Instead we need to calculate the size of folders and subfolders too. The article below will explain to calculate the size of the folder in three parts. The first part we will know will be the GetFolderSize method which will ... Read More

C# Program to Delete Empty and Non-Empty Directory

Ankit kumar
Updated on 21-Apr-2023 14:08:47

722 Views

Introduction On the computer, we can store files in a directory, also known as a folder. A directory also contains shortcuts to other directories and files. Here, we will discuss the C# Program to Delete Empty and Non-empty Directories. A static class called Directory offers static methods for dealing with directories. A DirectoryInfo object offers details on a particular directory. Delete Empty and Non-empty Directory Now that we have a directory (either empty or not), we must delete it. An empty directory indicates that there are no files or subdirectories present in the directory. A directory can be ... Read More

Create String from File Contents in C#

Ankit kumar
Updated on 21-Apr-2023 14:01:00

209 Views

Introduction Let us see how to create a C# program to create a string from the contents of a file. The string is an integral part of file handling. A string in C# is a series of letters. Like, "TutorialsPoint" is a string containing 't' 'u' 't' 'o' 'r' 'i' 'a' 'l' 's' 'p' 'o' 'i' 'n' 't' as characters. We use the string keyword to create a string. File handling or file management in layman's terms the various processes such as making the file, reading from it, writing to it, appending it, and so on. The viewing and writing ... Read More

C# Program to Copy a File

Ankit kumar
Updated on 21-Apr-2023 13:58:59

485 Views

Introduction C# is a high-level language that caters to the large needs of programmers. It can also help in copying a file. So, in this article, we will learn a C# Program to Copy a File. As we know file copying falls in the category of file handling. So, before we proceed further let us recap the definition of file handling. File handling or file management in layman’s terms the various processes such as making the file, reading from it, writing to it, appending it, and so on. The reading and writing of files are the two most ... Read More

Check If a Path Is a Directory or File in C#

Ankit kumar
Updated on 21-Apr-2023 13:53:26

5K+ Views

Introduction Let us learn how to write C# program to check if a path is a directory or a file. A directory, also known as a folder, is a place on your computer where you can save files. A directory holds other directories or shortcuts in addition to files. A file is a collection of data on a drive that has a unique identifier and a directory path. When a file is opened for viewing or writing, it is transformed into a stream. The stream is simply a sequence of bytes traversing the communication route. Files vs Directory ... Read More

Merge Two Sets in Swift

Ankita Saini
Updated on 21-Apr-2023 13:48:12

2K+ Views

Merging two sets means combining all the elements of a set into another set without any duplicates. In Swift, we can either use formUnion() function or for-in loop to merge the elements of two sets. Lets discuss both the methods in detail along with examples. Method 1: Using formUnion() Function To merge two sets we can use formUnion() function. The formUnion() function is used to insert the elements of the given sequence into the set. Here the sequence can be anything a set, array, etc. This function merge two sets without any duplicates. Syntax set1.formUnion(set2) Where set1 and set2 ... Read More

Initializing a Set in Swift

Ankita Saini
Updated on 21-Apr-2023 13:47:07

193 Views

In Swift, a set is used to define a collection of unique elements, means a set doesn’t contains duplicate elements. In a set, the elements are not arranged in a particular order. Initialising a set means to store some information in the set. It can be done at the time of declaration or after declaration. We can initialise a set in various way like initialising a set without explicitly passing data types, initialising a set with explicitly passing data types, and using inbuilt insert() function. Now lets discuss all the method in detail along with examples. Method 1 In this ... Read More

Iterate Over a Set in Swift

Ankita Saini
Updated on 21-Apr-2023 13:45:20

1K+ Views

In Swift, a set is used to define a unordered collection of unique elements. To iterate over an set swift provide inbuilt forEach() function as well as for-in loop. Lets discuss both the methods in detail along with examples. Method 1: Using for-in Loop To iterate over an set we can use for-in loop. The for-in loop iterate through each element of the set and display them on the screen one by one. Syntax for x in newSet{ print(x) } Where newset is the name of the set, and x variable store the current element from ... Read More

Difference Between Rows and Columns

Pradeep Kumar
Updated on 21-Apr-2023 12:27:20

2K+ Views

There is a huge amount of data being generated in our day to day lives. This data needs to be stored and accessed whenever it is needed. Data is stored in the form of tables or spreadsheets. A table is a collection of rows and columns. A row represents the horizontal part of data while column represents the vertical part of the data. What are Rows? Data arranged horizontally from left to right in a sequence is known as a row. This data can be numbers or words. Data is present in the form of a straight line from left ... Read More

Difference Between Processor and Operating System

Pradeep Kumar
Updated on 21-Apr-2023 12:21:28

5K+ Views

A computer is an electronic device that can store, manipulate and process the data. It consists of many hardware and software components. Processor and operating system are two important parts of a computer. While the processor is considered as the brain of the system, operating system acts as mind. What is a Processor? A processor is a small electronic circuit that is present in the motherboard which process and executes the programs and instructions in a computer, mobile phones and many other electronic devices. The processor is known as the brain of computer. Processor is mostly referred as CPU ... Read More

Advertisements