是一个平台:Net.Framework;
万事万物皆对象
对象三大特征:
属性;方法(主动行为);事件(被动行为)
计算机语言:机器语言:二进制语言(0、1)
C/S:client 客户端,各种APP软件
B/S:Browser 浏览器端程序 各种网站网页
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.Threading;
using System.Threading;
namespace _01demo
{
public partial class zhen : Form
{
public zhen()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
this.BackColor = Color.Blue;
this.Width = 300;
this.Height = 300;
this.Left = 300;
this.Top = 300;
//Thread:线程
}
private void button1_Click(object sender, EventArgs e)
{
Random a = new Random();//随机色
for (int i=0;i<5;i++)
{
this.Left = 305;
this.BackColor = Color.FromArgb(a.Next(255), a.Next(255), a.Next(255));
Thread.Sleep(50);
this.Top = 305;
this.BackColor = Color.FromArgb(a.Next(255), a.Next(255), a.Next(255));
Thread.Sleep(50);
this.Left = 300;
this.BackColor = Color.FromArgb(a.Next(255), a.Next(255), a.Next(255));
Thread.Sleep(50) ;
this.Left = 295;
this.BackColor = Color.FromArgb(a.Next(255), a.Next(255), a.Next(255));
Thread.Sleep(50);
this.Top = 300;
this.BackColor = Color.FromArgb(a.Next(255), a.Next(255), a.Next(255));
Thread.Sleep(50);
this.Top = 295;
this.BackColor = Color.FromArgb(a.Next(255), a.Next(255), a.Next(255));
Thread.Sleep(50);
this.Left = 300;
this.BackColor = Color.FromArgb(a.Next(255), a.Next(255), a.Next(255));
Thread.Sleep(50);
this.Left = 305;
this.BackColor = Color.FromArgb(a.Next(255), a.Next(255), a.Next(255));
Thread.Sleep(50);
this.Top = 300;
this.BackColor = Color.FromArgb(a.Next(255), a.Next(255), a.Next(255));
Thread.Sleep(50);
this.Left = 300;
}
}
}
}