1. Trang chủ
  2. » Công Nghệ Thông Tin

Tài liệu Enumerations docx

2 89 0
Tài liệu được quét OCR, nội dung có thể không chính xác
Tài liệu đã được kiểm tra trùng lặp

Đang tải... (xem toàn văn)

THÔNG TIN TÀI LIỆU

Thông tin cơ bản

Tiêu đề Enumerations
Tác giả Team Lib
Thể loại Tài liệu
Định dạng
Số trang 2
Dung lượng 10,69 KB

Các công cụ chuyển đổi và chỉnh sửa cho tài liệu này

Nội dung

[ Team LiB | A.7 Enumerations C# uses the enum statement along with opening and closing braces, { }, to indicate the beginning and end of an enumeration definition.. For example: public

Trang 1

[ Team LiB |

A.7 Enumerations

C# uses the enum statement along with opening and closing braces, { }, to indicate the beginning and end of an enumeration definition For example:

public enum CommandType {

// Enumeration members

}

In VB, an enumeration is defined by the Enum End Enum construct For example, the

VB version of the CommandType enum declaration is:

Public Enum CommandType

"enumeration members

End Enum

In both C# and VB, the member listing consists of the name of the enumerated member and its value These are identical in C# and VB, except that C# adds a comma to separate one member of the enumeration from another, whereas VB requires that they be on separate lines For example, the full declaration of the CommandType enumeration in C# 1S:

public enum CommandType {

Text = 1,

StoredProcedure = 4,

TableDirect = 512

}

The VB equivalent is:

Public Enum CommandType

Text = 1

StoredProcedure = 4

TableDirect = 512

End Enum

[ Team LiB |

Ngày đăng: 21/01/2014, 11:20

TÀI LIỆU CÙNG NGƯỜI DÙNG

TÀI LIỆU LIÊN QUAN

w