Sometimes it seems that it is often wrong.

xiaoxiao2021-03-06  40

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);} ///

/// Designer Supports the required method - Do not use the code editor to modify the // / this method. /// private void InitializeComponent () {this.Button1.Click = new System.EventHandler (this.Button1_Click); this.Button2.Click = new System.EventHandler (this.Button2_Click); this.Load = new system.eventhandler (this.page_load);

} #Endregion

Private void button1_click (object sender, system.eventargs e) {i ;}

转载请注明原文地址:https://www.9cbs.com/read-52406.html

New Post(0)