官术网_书友最值得收藏!

Chapter review

For review, the complete version of the Default.aspx.cs file for this chapter, including comments, is shown in the following code block:

//using is a directive
//System is a name space
//name space is a collection of features that our needs to run
using System;
//public means accessible anywhere
//partial means this class is split over multiple files
//class is a keyword and think of it as the outermost level of grouping
//:System.Web.UI.Page means our page inherits the features of a Page
public partial class _Default : System.Web.UI.Page
{
protected void Button1_Click(object sender, EventArgs e)
{
int x = 25, y = 34;//declare and set two variables
sampLabel.Text = $"x={x}, y={y}";//display variables
GenMethods.Swap (ref x, ref y);//swap values
sampLabel.Text += $"<br>x={x}, y={y}";//display swapped values
sampLabel.Text += GenMethods.Compare (x, y);
}
}
主站蜘蛛池模板: 许昌市| 怀化市| 绥江县| 定边县| 汶上县| 五台县| 高州市| 汝州市| 鄯善县| 东丰县| 南溪县| 辽源市| 盐城市| 镇巴县| 磐石市| 苍溪县| 同德县| 齐齐哈尔市| 定结县| 苍南县| 和硕县| 吕梁市| 垦利县| 松滋市| 郧西县| 东台市| 芜湖县| 金塔县| 偏关县| 科尔| 乐安县| 湟中县| 鄂托克旗| 乌鲁木齐市| 临沂市| 桓台县| 铁岭县| 乐安县| 寻甸| 南投县| 余庆县|