This article is a mirror article of machine translation, please click here to jump to the original article.

View: 40997|Reply: 2

[Source] C# Exceptional Multilingual Localization Support

[Copy link]
Posted on 2019-9-23 15:04:51 | | | |
C# exception types and corresponding exception classes
SystemException is a base class of exceptions that can be handled by other users
ArgumentException method is illegal
ArgumentNullException is passed to a method that cannot accept the argument
The ArgumentOutOfRangeException parameter value is out of range
ArithmeticException has an arithmetic overflow or underoverflow
ArrayTypeMismatchException attempts to store an object of the wrong type in the array
BadImageFormatException The graph is malformed
DivideByZeroException removes zero exceptions
DllNotFoundException The referenced DLL could not be found
FormatException parameter is formatted incorrectly
IndexOutOfRangeException The array index is out of range
InvalidCastException uses an invalid class
InvalidOperationException method is incorrectly timed
MethodAccessException attempts to access a ThoughtFriend or protected method
MissingMemberException accesses an invalid version of the DLL
The NotFiniteNumberException object is not a valid member
NotSupportedException is not implemented in the class
NullReferenceException attempts to use an unassigned reference
OutOfMemoryException There is not enough memory space
PlatformNotSupportedException throws an error when a specific property is not supported by the platform
StackOverflowException stack overflow

SystemException runtime for all errors that occur.
IndexOutOfRangeException is raised when running when an array of subscripts is out of range.
NullReferenceException is raised when an empty object is referenced when it runs.
InvalidOperationException is raised by some method when a call to a method is invalid for the current state of the object.

ArgumentException The base class for all parameter exceptions.
ArgumentNullException is raised by the method when the parameter is empty (not allowed).
ArgumentOutOfRangeException is raised by the method when the parameter is not within a given range.
InteropException targets the base class of the exception that occurs in or in an environment outside of the CLR.
ComException An exception that contains the HRESULT information of the COM class.
SEHException encapsulates exceptions in the Win32 structure to handle exceptions in information.
SqlException encapsulates SQL operation exceptions.






Difference between CurrentCulture and CurrentUICulture:

1. CurrentCulture: This property is used to define the "region options", standards, formats, etc. that users want to use.
2. CurrentUICulture: As the name suggests, this property is used to define the language used by users to log in to the system, such as in MUI (Multi-language).
User Interface), you can define the language you see displayed to you on the desktop.
This means that when you log in to the XP desktop, the interface can be in English (urrentUICulture), but you can choose "Taiwan" (CurrentCulture) for your numbers and the way the date is displayed and your location.
Using the "Region and Language" option in the Windows Control Panel, users can change the default settings for CurrentCulture. With this configuration, you can also change the culture's default number, time, and date format. CurrentUICulture does not depend on this configuration, but on the language of the operating system.


Customize the exception class

Different exception messages are thrown by obtaining the language of the current system region






Previous:Baidu SEO is a masterpiece
Next:C# tutorial for office web app server deployment and simple operation
Posted on 2019-9-24 16:22:08 |
The collection is ready for the day...
Posted on 2022-4-2 09:04:58 |
Thanks for sharing, reference, and doing research in this area
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com