current location:Home > Technical Articles > Backend Development > C#.Net Tutorial

  • LongLength property of arrays in C#
    LongLength property of arrays in C#
    In C#, the Array class has a read-only property called LongLength. It returns a long integer value indicating how many elements the array can hold. Only arrays of rank one or higher, that is, non-single-dimensional arrays, can access the LongLength property. Although the LongLength property provides long values, it is important to remember that the maximum size of an array in C# is still limited by the amount of memory supported by the system. If you try to build an array that is too large, an OutOfMemoryException may be thrown. Syntax publiclongLongLength{get;}Long-64-bit integer value, indicating the number of elements in the array. The number of elements in the entire array is passed in C#
    C#.Net Tutorial 1142 2023-09-17 16:49:15
  • C# program gets relative path from two absolute paths
    C# program gets relative path from two absolute paths
    Introduction Let us try to understand the C# program to get relative path from two absolute paths. We will use URI (Uniform Resource Identifier) ​​class and MakeRelativeUri method to understand. We first need to understand the difference between absolute paths and relative paths. An absolute path includes all the information needed to locate a file or directory on your system. An example of an absolute path is C:\ProgramFiles\GoogleChrome\filename.exe. Relative paths tell us the path to a file relative to the current directory the user is working in. Consider the similar example mentioned above, if the main executable is located in C:\ProgramFiles, then the relative
    C#.Net Tutorial 1556 2023-09-17 13:25:02
  • What is pattern matching in C# 7.0?
    What is pattern matching in C# 7.0?
    C# 7.0 introduced pattern matching in two situations: is expressions and switch statements. Patterns test whether a value has a certain shape and can be derived from a value that has a matching shape. Pattern matching provides a cleaner syntax for algorithms. You can perform pattern matching on any data type (even your own), whereas if/else, you always need primitives to match. Pattern matching can extract values ​​from expressions. Before pattern matching - example publicclassPI{ publicconstfloatPi=3.142f;}publicclassRectangle:PI{&nbsp
    C#.Net Tutorial 1491 2023-09-17 12:09:03
  • C# number boost
    C# number boost
    Number promotion, as the name suggests, is to promote a smaller type to a larger type, such as from short to int. In the example below we see number promotion multiplication in arithmetic operators. Short types are automatically promoted to larger types - example usingSystem;classProgram{ staticvoidMain(){ shortval1=99; ushortval2=11; &nbs
    C#.Net Tutorial 1028 2023-09-17 11:33:20
  • How to iterate over a C# list?
    How to iterate over a C# list?
    Declare a list and add elements - varproducts=newList<string>();//addingelementsproducts.Add("Belts");products.Add("T-Shirt");products.Add("Trousers");Use a loop Iteration-foreach(varpinproducts){ Console.WriteLine(p);} Example Let’s see the complete
    C#.Net Tutorial 661 2023-09-17 11:05:02
  • Reverse an array using C#
    Reverse an array using C#
    First, set the original array - int[]arr={1,2,3};//OriginalArrayConsole.WriteLine("OriginalArray=");for reach(intiinarr){ Console.WriteLine(i);} Now, use Array. reverse() method to reverse an array-Array.Reverse
    C#.Net Tutorial 844 2023-09-17 08:05:02
  • What are preprocessor directives in C#?
    What are preprocessor directives in C#?
    The C# compiler does not have a separate preprocessor; however, these directives are processed as if there were one. In C#, preprocessor directives are used to aid conditional compilation. Preprocessor directives give instructions to the compiler to preprocess information before actual compilation begins. Following are the preprocessor directives in C# - Sr.No. Preprocessor Directive & Description 1#define It defines a sequence of characters called symbol. 2#undef It allows you to undefine a symbol. 3#if It allows testing one or more symbols to see if they evaluate to true. 4#else It allows creating compound conditional directives together with #if. 5#elif It allows the creation of compound conditional instructions. 6#endif specifies conditions
    C#.Net Tutorial 860 2023-09-16 23:45:05
  • What are the three parts of default routing in ASP .Net MVCC#?
    What are the three parts of default routing in ASP .Net MVCC#?
    The ASP.NetMVC routing module is responsible for mapping incoming browser requests for specific MVC controller operations. When an ASP.NET MVC application starts, the application then registers one or more pattern routing tables with the framework to tell the routing engine how to handle any request patterns that match these. When the routing engine receives a request at runtime, it matches the requested URL against the registered URL pattern and gives a response based on the pattern match. ASP.NET introduced routing to eliminate mapping each URL to a physical file. Routes enable us to define URL pattern handlers that map to requests. System.Web.Routing is used by the MVC framework, but is also used by ASP.NET Dynamic Data
    C#.Net Tutorial 1042 2023-09-16 23:33:02
  • Check whether two ValueTuple T1 are equal in C#
    Check whether two ValueTuple T1 are equal in C#
    ValueTuple in C# is a structure used to represent a data structure, that is, a data type that can hold multiple values ​​of different types. Introduced in C# 7.0, ValueTuples are a major improvement over classic tuples as they provide semantic names for fields. This article aims to teach you how to compare two instances of ValueTuple to check if they are equal. let's start! Understanding ValueTuple in C# Before we continue, let us first understand what ValueTuple is. ValueTuple is a value type representation of a tuple. ValueTuple allows you to create tuples with named fields, which makes your code more readable and self-describing. This is a V
    C#.Net Tutorial 1456 2023-09-16 23:21:02
  • Substring in C#
    Substring in C#
    Substring is used to get the subpart of a string in C#. For this we have substring() method. Use the substring() method in C# to check if each substring has unique characters. Loop it until the length of the string. If any of the substrings matches another substring, it means that the string has no unique characters. You can try running the following command to determine if a string contains the codes for all unique characters. This example shows the usage of Substring() method - Example usingSystem;usingSystem.Collections.Generic;usingSystem.Linq;usin
    C#.Net Tutorial 928 2023-09-16 23:01:06
  • The difference between method overriding and method hiding in C#
    The difference between method overriding and method hiding in C#
    In C#, there are two mechanisms by which subclasses can redefine or provide new implementations of parent class methods. These two mechanisms are called method overriding and method hiding. Now based on the way the methods are reimplemented we can differentiate them. Following are the important differences between method overriding and method hiding. Serial Number Keyword Method Overriding Method Hide 1 Definition Method overriding is a mechanism to achieve polymorphism, where the parent class and the child class have the same method, including parameters and signature, which is called when it is called using a child class object Implementation in subclasses. Method hiding, on the other hand, can be defined as a technique where the user can redefine a method of a base class or parent class using the new keyword, thereby hiding the base class's main basic implementation of that particular method. 2. Access the parent class implementation in method rewriting, subclass
    C#.Net Tutorial 1539 2023-09-16 21:01:02
  • What interfaces does the Array class in C# implement?
    What interfaces does the Array class in C# implement?
    System.Array implements interfaces such as ICloneable, IList, ICollection and IEnumerable. The ICloneable interface creates a copy of an existing object, that is, a clone. Let us understand the ICloneable interface. It only has a Clone() method because it creates a new object that is a copy of the current instance. The following example shows how to perform cloning using the ICloneable interface - example usingSystem;classCar:ICloneable{ inwidth; &n
    C#.Net Tutorial 1287 2023-09-16 16:17:04
  • The difference between SortedList and SortedDictionary in C#
    The difference between SortedList and SortedDictionary in C#
    SortedList and SortedDictionary in C# are both data structure types used for data storage. Now we can distinguish them based on characteristics and properties. Following are the important differences between SortedList and SortedDictionary. Sr. Numbered keysSortedListSortedDictionary1 Memory Organization SortedList requires lower memory to store, so the memory state in this case is overhead. On the other hand, SortedDictionary requires more memory to store, so there is no bottleneck in memory state in its case. 2 Design SortedList to be implemented internally, just like so
    C#.Net Tutorial 772 2023-09-16 14:41:02
  • What is the purpose of the Program.cs file in a C# ASP.NET Core project?
    What is the purpose of the Program.cs file in a C# ASP.NET Core project?
    The ASP.NET Core Web application is actually a console project that starts execution. Starting from the entry point publicstaticvoidMain() in the Program class, we can create a hosted web application there. publicclassProgram{ publicstaticvoidMain(string[]args){ BuildWebHost(args).Run(); }&nbs
    C#.Net Tutorial 874 2023-09-16 14:21:02
  • Differences between JavaScript and C#
    Differences between JavaScript and C#
    Two programming languages ​​that have been widely used in the field of software development are JavaScript and C# (pronounce "Csharp"). Both languages ​​are employed for various purposes and each has its own advantages and disadvantages. The main application of JavaScript programming language is to create websites. It is often used to build dynamic and interactive websites
    C#.Net Tutorial 1250 2023-09-16 13:21:19

Tool Recommendations

jQuery enterprise message form contact code

jQuery enterprise message form contact code is a simple and practical enterprise message form and contact us introduction page code.
form button
2024-02-29

HTML5 MP3 music box playback effects

HTML5 MP3 music box playback special effect is an mp3 music player based on HTML5 css3 to create cute music box emoticons and click the switch button.

HTML5 cool particle animation navigation menu special effects

HTML5 cool particle animation navigation menu special effect is a special effect that changes color when the navigation menu is hovered by the mouse.
Menu navigation
2024-02-29

jQuery visual form drag and drop editing code

jQuery visual form drag and drop editing code is a visual form based on jQuery and bootstrap framework.
form button
2024-02-29

Organic fruit and vegetable supplier web template Bootstrap5

An organic fruit and vegetable supplier web template-Bootstrap5
Bootstrap template
2023-02-03

Bootstrap3 multifunctional data information background management responsive web page template-Novus

Bootstrap3 multifunctional data information background management responsive web page template-Novus
backend template
2023-02-02

Real estate resource service platform web page template Bootstrap5

Real estate resource service platform web page template Bootstrap5
Bootstrap template
2023-02-02

Simple resume information web template Bootstrap4

Simple resume information web template Bootstrap4
Bootstrap template
2023-02-02

Cute summer elements vector material (EPS PNG)

This is a cute summer element vector material, including the sun, sun hat, coconut tree, bikini, airplane, watermelon, ice cream, ice cream, cold drink, swimming ring, flip-flops, pineapple, conch, shell, starfish, crab, Lemons, sunscreen, sunglasses, etc., the materials are provided in EPS and PNG formats, including JPG previews.
PNG material
2024-05-09

Four red 2023 graduation badges vector material (AI EPS PNG)

This is a red 2023 graduation badge vector material, four in total, available in AI, EPS and PNG formats, including JPG preview.
PNG material
2024-02-29

Singing bird and cart filled with flowers design spring banner vector material (AI EPS)

This is a spring banner vector material designed with singing birds and a cart full of flowers. It is available in AI and EPS formats, including JPG preview.
banner picture
2024-02-29

Golden graduation cap vector material (EPS PNG)

This is a golden graduation cap vector material, available in EPS and PNG formats, including JPG preview.
PNG material
2024-02-27

Home Decor Cleaning and Repair Service Company Website Template

Home Decoration Cleaning and Maintenance Service Company Website Template is a website template download suitable for promotional websites that provide home decoration, cleaning, maintenance and other service organizations. Tip: This template calls the Google font library, and the page may open slowly.
Front-end template
2024-05-09

Fresh color personal resume guide page template

Fresh color matching personal job application resume guide page template is a personal job search resume work display guide page web template download suitable for fresh color matching style. Tip: This template calls the Google font library, and the page may open slowly.
Front-end template
2024-02-29

Designer Creative Job Resume Web Template

Designer Creative Job Resume Web Template is a downloadable web template for personal job resume display suitable for various designer positions. Tip: This template calls the Google font library, and the page may open slowly.
Front-end template
2024-02-28

Modern engineering construction company website template

The modern engineering and construction company website template is a downloadable website template suitable for promotion of the engineering and construction service industry. Tip: This template calls the Google font library, and the page may open slowly.
Front-end template
2024-02-28