. HTTP là không quốc tịch bởi vì nó chỉ dành cho các nhiệm vụ đơn giản lấy các trang để hiển thị. Internet sẽ rất chậm và thậm chí có thể sụp đổ nếu các kết nối thường trực (tiểu bang) cần được duy trì giữa khách hàng và máy chủ, như những người di chuyển từ trang này sang trang khác. | Control Structures and Procedural Programming html head title Do While Loop Example title head body asp label id message1 runat server body html 2. View this page in your browser as shown in Figure 4-10 and click the Refresh button several times Figure 4-10 How It Works We started by declaring a variable that will hold the result of the diceRoll. Then we put some text into . This line mainly demonstrates a line before a loop - it will only be executed once. When you start building complex pages you will need to keep a clear idea of what is inside and outside of the loop script runat server void Page_load Random r new Random int diceRoll Lets get started. br Then we run the loop. If the last dice roll was anything other than a 6 we want to roll again so we use the inequality operator to tell C to keep running the loop so long as the dice roll is not equal to six. We do this because we want the loop to stop once we have a six. We finish with a demonstration of a line after the loop do 153 Chapter 4 diceRoll 6 1 Rolled a diceRoll br while diceRoll 6 There is our six. script When diceRoll equals six it will stop and not execute the contents of the loop instead jumping to the next statement beyond the loop. Use when actions within the loop absolutely have to occur at least once no matter what the result of the expression. Use while when there are actions within the loop that should not execute if the expression is false. Modulo example You came across the modulo operator in the last chapter and early on in this chapter. Recall that modulo returns the remainder of a division. You can refer to these sections to jog your memory about what modulo can do. Here we will apply this operator to our dice example. Open change the code as shown and save as . This modification will give the user an encouragement message with every third roll @ Page