...
}
Kết quả:
Drawing Window at: 5, 10
Drawing Window at: 20, 10
ListBox write: Hello world!
Ví dụ 5 .1 bắt đầu với việc khai báo một lớp cơ sở tên Window. Lớp này ... dữ liệu
· Boxing thực hiện ngầm định
· Unboxing phải thực hiện tường minh
· Các lớp lồng nhau
· Câu hỏi & bài tập
Trong chương trước đã trình bày cách tạo ra nhữ
ng kiểu dữ liệu ... phươ...
... (mục 9 .10 ) và kiểm tra hai file có trùng nhau hay không (mục 9 .11 ).
Làm việc với các chuỗi có chứa thông tin đường dẫn (mục 9 .12 đến 9 .14 ).
Theo dõi sự thay đổi của hệ thống file (mục 9 .19 ). ... rằng Attributes được tạo thành (ở dạng
nhị phân) bởi một dãy các chữ số 0 và 1, chẳng hạn 00 010 011 . Mỗi chữ số 1 cho
biết một thuộc tính được thiết lập, mỗi chữ số 0 cho biết mộ...
... 1. 1 Xác định đường dẫn tương ứng với một file hay thư mục
V
V
Bạn có một đường dẫn (ở dạng chuỗi), ... FileStream(tempFile, FileMode.Open);
// (Ghi dữ liệu. )
fs.Close();
// Xóa file.
File.Delete(tempFile);
Console.ReadLine();
}
}
1. 4 Lấy dung lượng đĩa còn trống
V
V
Bạn cần ... dùng cố ý thay đổi thư mục làm việc để ứng dụng của bạn
truy xuất hoặc ghi đè...
... the members of the System.Data.DataRowVersion enumeration;
the others are shown in Table 11 .9
.
Table 11 .9: DataRowVersion ENUMERATION MEMBERS
CONSTANT DESCRIPTION
Current The current column ... table.
Note You'll find a complete program named AddModifyAndRemoveDataRows.cs in the
ch 11 directory that illustrates the use of the methods shown in this section. This
program lis...
... exists, right-click
the container, and select the Create New Policies command (Fig. 9 .1
).
Figure 9 .1: Creating a new Software Restriction Policy
N
ote To create or manage Software Restriction ... to lock automatically when left unattended for a few minutes.
Usually this interval is set from 10 to 20 minutes, but for those desktops holding
sensitive data the recommended value is...
... Server 2003 system. If you make such an attempt, you'll get an error message
(Fig. 9 .18
).
Figure 9 .18 : When an attempt to copy the registry of the running Windows NT/2000,
Windows XP, or ... option. The list of user
rights will appear in the right pane of this window (Fig. 9 .19
).
Figure 9 .19 : The list of user groups allowed to reboot the system (Windows Server 2003
do...
... biên dịch lại, thì trình biên dịch sẽ đưa ra một cảnh báo giống như
sau:
…\class1.cs(54, 24): warning CS 011 4: ‘ListBox.Sort( )’ hides
inherited member ‘Window.Sort()’.
To make the current ... cũng là
một
Window.
Window[] winArray = new Window[3];
winArray[0] = new Window( 1, 2 );
winArray [1] = new ListBox( 3, 4, “List box is array”);
winArray[2] = new Button( 5, 6 );
Ch...
... của lớp Object.
Boxing và Unboxing dữ liệu
Boxing và unboxing là những xử lý cho phép kiểu dữ liệu giá trị (như int, long, )
được
đối xử như kiểu dữ liệu tham chiếu (các đối tượng). Một giá ... ToString( ) trên
kiểu d
ữ liệu int trong ví dụ 5.4.
Boxing được thực hiện ngầm định
Boxing là một sự chuyển đổi ngầm định của một kiểu dữ liệu giá trị sang kiểu
dữ liệu tham chi...
... 6.00.2600.0000
Company Name: Microsoft Corporation
File Version: 6.00.2600.0000 (xpclient. 010 817 -11 48)
File Description: Windows Explorer
Original Filename: EXPLORER.EXE
Legal Copyright: ... e.Node.Nodes.Clear();
Fill(e.Node);
}
}
}
Hình 9 .1 Một cây thư mục với TreeView
1. 3 Đọc và ghi file văn bản
V
V
Bạn cần ghi dữ liệu vào một file văn bản theo kiểu mã hóa ASCI...
... 1. 1 Đọc file một cách bất đồng bộ
V
V
Bạn cần đọc dữ liệu từ một file mà không phải dừng quá trình thực thi mã lệnh
của ... khối dữ liệu
bằng phương thức FileStream.BeginRead, và truyền phương thức callback.
Khi callback được kích hoạt, gọi FileStream.EndRead để truy xuất dữ liệu, xử
lý nó, và đọc khối dữ liệu kế ... xác định kích thước khối dữ liệu trong một
lần đọc. Tùy...