OOP:面向?qū)ο缶幊? S2S1:語法基礎(chǔ)++++++邏輯思維S2:面向?qū)ο笏季S+創(chuàng)新思維++++項目驅(qū)動Y2:框架++++源碼++++++對整個真正的項目,全局的把控1.封裝:類(屬性++方法) 私有字段封裝成共有的屬性2.泛型集合++++++重點3.xml解析技術(shù)4.IO流 +++++++--------------------------------------------------------------預(yù)習(xí)檢查:1. .NET 框架的兩個主要組件是什么? 解析: 2.任何人 在任何地方 使用任何終端設(shè)備 服務(wù)3.前惠普ceo 卡莉·菲奧莉娜 艱難的抉擇hp 康柏合并李納斯 寫的linux Unix MinuxGhost 安裝版FCL(Framework Class Library 框架類型)4.CLR=========CLS(Common Language Specfication 公共語言規(guī)范)+CTS(Common Type System 通用類型系統(tǒng)) 基本框架類::線程類 5.WF:Work Flow :工作流 WCF:底層通信 HTTp Ftp WPF:更酷炫 Linq:是一種類似于數(shù)據(jù)的能獲取數(shù)據(jù)的語言 from c in db.xxxx 6.類庫一堆類的集合 10個 dll神器:Reflector7.類圖作用:清晰的反饋出類結(jié)構(gòu) :字段 屬性 方法using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Linq;using System.Text;using System.Threading.Tasks;using System.Windows.Forms;namespace WindowsFormsapplication4{ public partial class denglu : Form { public denglu() { InitializeComponent(); } public LoginInfo[] persons = new LoginInfo[10]; public void LoadData() { persons[0] = new LoginInfo(); persons[0].Name = "李小龍"; persons[0].PassWord = "1"; persons[0].Email = "lxl"; persons[0].Id = "001"; persons[1] = new LoginInfo(); persons[1].Name = "李小龍2"; persons[1].Password = "2"; persons[1].Email = "lxl2"; persons[1].Id = "002"; persons[2] = new LoginInfo(); persons[2].Name = "鞏俐"; persons[2].Password = "3"; persons[2].Email = "gl"; persons[2].Id = "003"; } PRivate void label3_Click(object sender, EventArgs e) { zhuce frm = new zhuce(); frm.mylogin = this; frm.Show(); this.Visible = false; } private void button1_Click(object sender, EventArgs e) { //if(textBox1.Text.Trim().Equals(null)||textBox2.Text.Trim().Equals(null)){ // MessageBox.Show("用戶名或密碼不能為空", "提示"); //} //LoadData(); //01.用戶會輸入用戶名和密碼 string email = textBox1.Text; string pwd = textBox2.Text; //02.將用戶輸入內(nèi)容與數(shù)組中的每一項對比,如果有匹配項目,登陸成功 bool flag = false;//登陸狀態(tài),默認(rèn)為失敗 foreach (LoginInfo item in persons) { if (item != null) { //參與比較 if (email.Equals(item.Email) && pwd.Equals(item.Password)) /// if (email == item.Email && pwd == item.Password) { //證明用戶輸入的信息均正確,登陸成功 flag = true; zhujiemian frm = new zhujiemian(); frm.name = email; frm.textBox1.Text = "歡迎," + item.Name; frm.Show(); break; } } else if(email.Equals("") && pwd.Equals("")){ MessageBox.Show("用戶名或密碼不能為空","提示"); } } if (!flag) { MessageBox.Show("用戶名或者密碼錯誤!"); } //03.寫一個方法來給數(shù)組中前三項賦值 } private void Form1_Load(object sender, EventArgs e) { LoadData(); } }}using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Linq;using System.Text;using System.Threading.Tasks;using System.Windows.Forms;using System.Data.SqlClient;namespace WindowsFormsApplication4{ public partial class zhuce : Form { public zhuce() { InitializeComponent(); } public denglu mylogin; private void button1_Click(object sender, EventArgs e) { //01.非空驗證自己判定下 //02.先構(gòu)造出一個LoginInfo對象 然后將LoginInfo對象添加到persons數(shù)組中 LoginInfo info = new LoginInfo(); info.Name = textBox1.Text; info.Email = textBox3.Text; info.Password = textBox4.Text; info.Id = textBox2.Text; //就是將info天際到數(shù)組中 //數(shù)組有10個位置,要把info扔到什么位置 for (int i = 0; i < mylogin.persons.Length; i++) { if (mylogin.persons[i] == null) { mylogin.persons[i] = info; MessageBox.Show("注冊成功"); mylogin.Visible = true; this.Close(); break; } } } private void button2_Click(object sender, EventArgs e) { this.Close(); } }}using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Linq;using System.Text;using System.Threading.Tasks;using System.Windows.Forms;namespace WindowsFormsApplication4{ public partial class zhujiemian : Form { public string name; public zhujiemian() { InitializeComponent(); } private void pictureBox1_Click(object sender, EventArgs e) { Application.Exit(); } private void textBox1_TextChanged(object sender, EventArgs e) { this.Text = name; } private void Form3_Load(object sender, EventArgs e) { } }}using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading.Tasks;namespace WindowsFormsApplication4{ public class LoginInfo { //private string _email; //private string _id; //private string _name; //private string _password; //public string Email //{ // get // { // throw new System.NotImplementedException(); // } // set // { // } //} //public string Id //{ // get // { // throw new System.NotImplementedException(); // } // set // { // } //} //public string Name //{ // get // { // throw new System.NotImplementedException(); // } // set // { // } //} //public string Password //{ // get // { // throw new System.NotImplementedException(); // } // set // { // } //} public string Name { get; set; } public string Id { get; set; } public string Email { get; set; } public string Password { get; set; } }}
新聞熱點
疑難解答