current location:Home > Technical Articles > Backend Development > C#.Net Tutorial
- Direction:
- All web3.0 Backend Development Web Front-end Database Operation and Maintenance Development Tools PHP Framework Daily Programming WeChat Applet Common Problem Other Tech CMS Tutorial Java System Tutorial Computer Tutorials Hardware Tutorial Mobile Tutorial Software Tutorial Mobile Game Tutorial
- Classify:
-
- 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
- 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?
- 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{ 
- C#.Net Tutorial 1491 2023-09-17 12:09:03
-
- 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?
- 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#
- 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#?
- 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#?
- 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#
- 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 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#
- 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?
- 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#
- 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?
- 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#
- 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