C # Is a new language launched by Microsoft with VS.net. As an emerging language, it has strong C ++ and RAD features such as VB. Moreover, Microsoft launched C # mainly to combat Sun's Java. Everyone knows the powerful functions of Java, especially
6. Enumeration
Enumeration allows you to specify a group of objects, for example:
Statement:
Public enum Direction {North, East, West, South };
Usage:
Direction wall = Direction. North;
This is really an elegant concept. This is why C # decides to
14. Parameter Modifier
(1) ref parameter Modifier
C # (compared with Java) allows you to pass parameters by reference. The most obvious example to describe this is the general exchange method. Unlike C ++, the ref directive must be added when
In C #, you can use methods to organize applications into more structured individuals. A Method is a member of a class and can be used to execute a job or calculate some numeric values.One method is a collection of C # programming languages with a
Benefits of using namespaces
U program code can be dispersed in multiple filesU namespace extensibilityU can build a hierarchical class Organizational StructureHow to Use namespacesU uses PascalCasing to separate logical groupsU. We recommend that
Some people forget the time when they use their computers, so I want to make a small tool to implement the alarm function.
First of all, we need to design the user interface and introduce the ease of use, so we don't have to worry too much about
Use attributes to avoid direct exposure of data members to the outside world
When I was studying. NET in the early days, I often encountered some friends who learned C #/. NET and asked what to do with attribute-based flashy things? Later, when I
I. Introduction 1. Introduction of the problemAssume that the program you designed has been deployed on your computer and runs properly. But one day, the user called and asked for new features. After determining the user's requirements, you can find
In C #2.0, the cooperation between anonymous methods, IEnumerable interfaces, and anonymous methods makes many programming tasks very simple and the programs written are very beautiful.For example, we can write the following code:
List
You are familiar with the use of stored procedures in SQL Server. Recently, I made a small job, and the database uses the MS Access database. I also want to try to use the stored procedure. After all, the relationship between stored procedures and
Database access is the most important part of all programming languages. C # provides the ADO. Net component for accessing the database. We will start with the most easy-to-use Microsoft Access database and discuss Access to the database in C.The
C # Hide the Window appllication as the taskbar icon when writing the minimal code.
1. Set the WinForm attribute showinTask to false.
2. Add the policyicon control policyicon1 to add an Icon for the property icon of the control policyicon1.
3. Add a
You have made a widget so that you can say goodbye to the image button :)
Program source code:
Using System;Using System. Collections;Using System. ComponentModel;Using System. Drawing;Using System. Data;Using System. Windows. Forms;Using System.
Someone suggested using the int. Parse (string) method, and then capture exceptions to determine the returned value. A better way is to use a regular expression:Public int IsNumeric (string str){Int I;If (str! = Null & Regex. IsMatch (str, @ "^ d + $
Export DataTable data to Execl formatThe source code is as follows:First, a new dialog box is saved:
Private System. Windows. Forms. SaveFileDialog m_objSave = new SaveFileDialog ();// Data export MethodPublic void m_mthExportToExecl (){This.
I recently read a book about the game. There is a simple game of cooperation and non-cooperation. It is very interesting. The general idea is as follows:This game is A simple abstraction of cooperation between people in real life. The specific
What is a processing command? Processing Instructions (PI) uses "" A tag that describes information about a specific application. Xml documents can contain multiple processing commands for different applications. The Processing Command consists of
The basic operations of a linear table are defined as follows:Public interface IListDS {Int GetLength ();Void Clear ();Bool IsEmpty ();Void Append (T item );Void Insert (T item, int I );T Delete (int I );T GetElem (int I );Int Locate (T value );Void
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.