- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Found 2724 Articles for Csharp

Updated on 21-Apr-2023 14:36:44
Introduction Let us try to understand the C# program to get the relative path from two absolute paths. We will understand using the URI( Uniform resource identifier) class and the MakeRelativeUri method. We will first understand the difference between absolute and relative paths. The absolute path includes all information required to locate a file or directory on a system. An example of an absolute path is C:\Program Files\Google Chrome\filename.exe. The relative path tells us the file's path with respect to the current directory on which the user is working. Considering the similar example mentioned above if the main executable ... Read More 
Updated on 21-Apr-2023 14:33:44
Introduction Let us try to understand the C# program to get the name of the file from the absolute path. We will see the usage of the GetFileName method which comes under the File class to get the name of the file, and another method GetFileNameWithoutExtension which will return the file name of the specified path string without extension. To get the relative path from two absolute paths, we will make use of the Uri class in C#. The Uri class provides several methods for working with URIs, including MakeRelativeUri, which we will use in our code. A file is ... Read More 
Updated on 21-Apr-2023 14:31:23
Introduction Let us see how to use the instrumental environment class of C# to write a C# Program to Get and Print the Command Line Arguments Using Environment Class. Knowing all the things about C#, we will now understand one of the uses of the system.environment class in C# and then we will learn to code a program that will get and print the command line arguments. Basically, it will take strings as arguments and will have its return type as a string. Before diving into the program we must have an overview of what is environment class in detail ... Read More 
Updated on 21-Apr-2023 14:30:04
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. If we want to know what all files have stored in a directory then C# also offers an easy way to do so. In this article, we will be learning a C# program to get all files present in a directory. There are more than a couple of ways to know the files available in the directory. Let us discuss them in the upcoming sections. 1. GetFiles() Method For knowing the name ... Read More 
Updated on 21-Apr-2023 14:27:37
Introduction There are a lot of ways to generate a mark sheet for a student. Today we will learn one of them. In this article, we will learn a C# program to generate the mark sheet of a student. Let us learn the algorithm first. Algorithm Let us discuss the algorithm to write the program which generates the mark sheet of a student. The student has to give the input to the system and then the mark sheet is generated. Step 1 − Firstly we declare the integer variables for storing the different data such as the roll ... Read More 
Updated on 21-Apr-2023 14:25:55
Introduction In this article, we are going to find the greatest number in an array using the WHERE clause in LINQ. LINQ (Language Integrated query) is used to generate queries in C# Language. The best part of LINQ is that it provides a unified source of the method to access data from different sources like databases and XML documents. With the help of LINQ, users can write code that has much better readability and the code is much more concise and good-looking. It also provides other functionalities like filtering, sorting, grouping data and even changing them. Before moving ahead we ... Read More 
Updated on 21-Apr-2023 14:19:06
Introduction In this article, we will understand the C# program to find out the value of Sin(x). Sine is another name for Sin(x). It is a trigonometric angle formula. The sine of an angle is the proportion of the length of the hypotenuse to the length of the perpendicular in a right-angled trapezoid. The robust computer language C# can be used to resolve challenging mathematical issues. Finding the value of sin(x), where x is any angle in radians, is one of these issues. In this article, we'll look at how to use the Math library to create a C# program ... Read More 
Updated on 21-Apr-2023 14:16:25
Introduction In this article, we will learn how to write a C# program to find integer numbers from the list of objects and sort them using LINQ. Let's have a small overview of the language. The C# programming language is frequently used to develop desktop, web, and mobile apps. Linguistic Integrated Query, sometimes known as LINQ, is one of C#'s strong points. Developers may quickly query data from various sources, including arrays, collections, and databases. It gives developers access to a syntax that is comparable to SQL (Structured Query Language) and enables simple data manipulation and sorting. Regardless of the ... Read More 
Updated on 21-Apr-2023 14:14:28
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 
Updated on 21-Apr-2023 14:08:47
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 Advertisements