- Beginning C# 7 Hands-On:Advanced Language Features
- Tom Owsiak
- 132字
- 2021-07-02 15:29:18
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);
}
}
推薦閱讀
- Mastering Ext JS(Second Edition)
- 自然語言處理實戰:預訓練模型應用及其產品化
- Podman實戰
- The Data Visualization Workshop
- Building Serverless Web Applications
- uni-app跨平臺開發與應用從入門到實踐
- C指針原理揭秘:基于底層實現機制
- HTML+CSS+JavaScript網頁制作:從入門到精通(第4版)
- 會當凌絕頂:Java開發修行實錄
- Python網絡爬蟲實例教程(視頻講解版)
- Learning Image Processing with OpenCV
- 用Python動手學統計學
- 你必須知道的.NET(第2版)
- Visual C++程序設計全程指南
- 秒懂算法:用常識解讀數據結構與算法