120 CAU _GUI KHOA_ KHOA _25

Cho đoạn lệnh sau, xác định chức năng của đoạn lệnh? sub Page_Load(obj as object, e as eventArgs) dim strVariable as string 'set up some cookie variab

54/122

Cho đoạn lệnh sau, xác định chức năng của đoạn lệnh?

sub Page_Load(obj as object, e as eventArgs)

dim strVariable as string

'set up some cookie variables

Response.Cookies("MyASPNETPage")("Username") = "Sinhvien"

Response.Cookies("MyASPNETPage")("Password") = "TakeMeHome"

Response.Cookies("MyASPNETPage")("Preference") = "800x640"

Response.Cookies("MyASPNETPage")("UserAgent") = _

Request.ServerVariables("HTTP_USER_AGENT")

for each strVariable in Response.Cookies("MyASPNETPage").Values

lblCookies.Text += "<b>" & strVariable & "</b>: " & _

Request.Cookies("MyASPNETPage")(strVariable) & "<br>"

next

end sub

Dùng Respone để lưu trữ 1 số thông tin

Dùng Request để lưu trữ 1 số thông tin

Dùng Variables để lưu trữ 1 số thông tin

Dùng Cookies để lưu trữ 1 số thông tin

Giải thích

Đáp án: D