When a classmate interview, I met two simple topics. I had a loop for a few minutes, but I was wrong. Everyone watched the wrong: (1) Write a console program to enter a number and then output this number (2) write A ASP.NET program, 2 buttons on the page, the page is loaded, the variable i = 0, click on the first button I value 1, click the second button to output this variable I in a Label tag on the page (all The user is independent, not sharing i) The classmates will feel very simple, so I wrote the following procedures (1) static void main (string [] args) {Int i = console.read (); console.writeline I.TOString ()); (c.toString ());} is just right! (2) public class WebForm13: System.Web.UI.Page {protected System.Web.UI.WebControls.Button Button1; protected System.Web.UI.WebControls.Button Button2; protected System.Web.UI.WebControls.Label Label1 ; Int I; private void page_load (object sender, system.eventargs e) {// Place the user code here to initialize the page i = 0;}
#Region Web Form Designer Generated Code Override Protected Void OnNit (Eventargs E) {// // Codegen: This call is required for the ASP.NET Web Form Designer. // InitializeComponent (); base.onit (e);} ///
} #Endregion
Private void button1_click (object sender, system.eventargs e) {i ;}