寒假总结(2)鼠标键盘系统的基本操作
- 格式:docx
- 大小:35.13 KB
- 文档页数:32
鼠标和键盘的基本操作鼠标和键盘是计算机最常见的输入设备,是人与电脑之间进行交互的重要工具。
对于初学者来说,学会基本的操作方法和技巧是学习计算机的第一步,本文将介绍鼠标和键盘的基本操作方法。
鼠标的基本操作单击单击是鼠标最常用的操作之一,它是指轻轻按下鼠标左键一次。
单击可以用来选中文件或文本,打开程序或文件等操作。
双击双击是在鼠标左键快速连续按下两次的操作,它常用来打开文件或程序。
双击速度很重要,如果双击速度太快或太慢,会导致程序不能正确打开。
右键单击右键单击是在鼠标右键点击一下,主要用于弹出上下文菜单。
上下文菜单通常提供了一些与当前操作相关的选项,如复制、粘贴、删除等。
滚动滑轮滚动滑轮通常位于鼠标中间,它可以用来向上或向下滚动当前窗口的内容。
在浏览网页时,滚动滑轮可以快速滚动网页。
拖拽拖拽是指在鼠标左键按下的同时拖动鼠标,用于移动文件或文本。
拖拽文件可以将文件从一个文件夹中拖到另一个文件夹中,拖拽文本可以将文本从一个应用程序中拖到另一个应用程序中。
键盘的基本操作键盘快捷键键盘快捷键是指在按下一些组合键时,可以快速执行某些操作。
例如,在Windows 操作系统中,按下 Ctrl + C 可以复制选中的文本或文件,在 Mac 操作系统中则需要按下 Command + C。
复制和粘贴复制和粘贴是键盘上最常用的操作之一。
在 Windows 操作系统中,复制选中的文本或文件可以使用 Ctrl + C 快捷键;在 Mac 操作系统中则需要使用 Command+ C 快捷键。
粘贴已复制的文本或文件可以使用 Ctrl + V 或 Command + V 快捷键。
删除和撤销删除和撤销也是键盘上常用的操作之一。
在 Windows 操作系统中,删除选中的文本或文件可以使用 Delete 键;在 Mac 操作系统中则需要使用 Fn + Delete 键。
撤销最近的操作可以使用 Ctrl + Z 或 Command + Z 快捷键。
计算机键盘的基本操作知识详细介绍键盘及指法操作一、键盘的基本结构1. 主键盘区:包括字母键、数字键、特殊字符键等。
字母键和数字键位于键盘的中间区域,用于输入字母、数字和符号。
特殊字符键位于主键盘区的顶部和右侧,包括回车键、Tab键、Shift键等。
2.数字小键盘区:位于键盘的右侧,用于输入数字。
数字小键盘通常用于数学计算和电子表格应用中。
3.功能键区:位于键盘的顶部,包括F1至F12键。
这些按键通常与特定的功能相关联,例如调整音量、亮度等。
4. 控制键:包括Shift键、Ctrl键、Alt键和Windows键等。
这些按键通常与组合键一起使用,用于执行特定的操作,如复制、剪切和粘贴等。
二、指法操作1.手指的位置:在开始学习键盘操作前,需要了解手指的位置。
左手的食指放在键盘的F键上,中指放在D键上,无名指放在S键上,小指放在A键上。
右手的食指放在J键上,中指放在K键上,无名指放在L键上,小指放在分号键上。
双手手指静止时应该平放在键盘上。
2. 基本按键:学习键盘的基本按键是非常重要的,包括字母键、数字键和空格键等。
可以通过双手指操作字母键和数字键,通过按下Caps Lock键切换大写和小写。
空格键用于在文字之间插入空格。
3. 功能键和控制键:学习掌握不同功能键和控制键的操作也是很重要的。
例如,Shift键用于输入大写字母和特殊字符。
Ctrl键通常与其他键一起使用,用于执行特定的操作,例如复制、剪切和粘贴。
Alt键和Windows键用于执行其他系统级操作。
5.功能键:功能键通常用于执行特定的功能。
例如,F1键可以打开帮助文档,F5键可以刷新页面,F12键可以打开脚本调试工具等。
这些功能键的具体操作可能因不同的软件和操作系统而有所区别。
6. 快捷键:快捷键是利用组合键来进行操作。
例如,Ctrl+C用于复制选中的内容,Ctrl+V用于粘贴复制的内容,Ctrl+Z用于撤销操作等。
掌握常用的快捷键可以提高工作效率。
鼠标键盘使用方法1. 嘿,你知道鼠标咋用不?这鼠标就像你手里的小魔杖。
你看,它有左键和右键,就像魔杖的不同魔法咒语。
比如说,你想打开一个文件,就像你要打开一个魔法宝箱,只要轻轻点一下左键,“啵”的一下,文件就打开啦。
可别小瞧这简单的操作,好多人还在这儿犯迷糊呢!2. 咱再说说鼠标滚轮,这滚轮可太实用了。
你可以把它想象成一个小电梯,想让网页或者文档往上走或者往下走,就滚动这个滚轮呗。
比如说你在看一篇超长的文章,滚轮轻轻一转,就像小电梯带着你在文字的高楼里上上下下,多方便呐。
你要是不会用这个滚轮,那可就像住在高层却只能爬楼梯,累得慌啊!3. 键盘这玩意儿,每个键都有它的脾气。
先说说字母键,这就像是一群听话的小士兵,你想打字的时候,只要按照你的想法指挥它们就行。
比如你想写“你好”,就依次按下“n”“i”“h”“a”“o”这几个小士兵,它们就乖乖地站成了你想要的字。
要是按错了,哎呀,那就像小士兵走错了队列,乱套喽。
4. 数字键呢,就像是你的小算盘珠子。
当你要输入电话号码或者计算一些东西的时候,它们就派上用场了。
就像你去商店买东西算账,数字键“1”“2”“3”就开始工作啦。
你要是在输密码的时候按错了数字键,那可就像算错了账,门都进不去啦,多闹心啊!5. 还有那些功能键呢!F1到F12就像是隐藏在键盘里的神秘小机关。
比如说F5,这可是个神奇的键,就像一个刷新小按钮。
当你觉得网页有点卡,或者显示不正常的时候,按一下F5,就像给网页洗了个脸,一下子就清爽了,又能好好地显示内容了。
你要是不知道这个键,就只能干等着网页自己变好,那得多着急呀。
6. 回车键就像一个确认的大印章。
你写完一段话,或者输完一些信息,按一下回车键,就像是盖了个章,表示“我确定啦”。
比如说你在聊天框里打完字,按回车键消息就发出去了,就像把写好的信装进信封寄出去一样。
要是你老是忘记按回车键,那你的话就一直在那儿憋着,像话被卡在喉咙里出不来一样。
7. 那删除键呢?它就是个纠错小能手。
步骤/方法1一:基本硬件组成简介(1) 计算机的基本组成计算机从外观上来瞧主要有主机与显示器组成,计算机系统由运算器,控制器,存储器,输入设备与输出设备五大部分组成。
运算器与控制器集成在一起又称为中央处理器简称为CPU;存储器分为内部存储器与外部存储器,内部存储器简称为内存(RAM),外部存储器简称为外存如硬盘,光盘,移动磁盘等;输入设备就是用来从外界向计算机系统输入数据的唯一途径,常见的输入设备有鼠标,键盘,扫描仪等;输出设备就是计算机将处理结果显示给用户的,常见的输出设备有显示器,绘图仪,音响等。
(2) 主机的组成主机由主板,内存, CPU,硬盘,光驱,数据线与电源。
(3) 主机面板按钮开机按钮(Power),复位键(Rest)死机时按一下该键系统将重新启动。
(4) 面板接口计算机主机前面板上一般有USB与音响与话筒接口,BUS接口又称为即插即用接口(不用关闭计算机系统,在开机状态可以直接插),USB设备均可以使用此接口与计算机相连接,常见的USB设备有USB键盘,USB鼠标,USB口打印机,U 盘,移动硬盘等,此外还可以用来与数码相机,手机相连接。
用户要特别注意的就是我们称USB设备为即插即用设备但就是向移动类存储磁盘最好不要直接拔出,因为这样容易损坏磁盘导致数据丢失。
正确的方法就是:单击桌面右下角的图标,然后单击右下角弹出的小窗口,等出现“安全删除USB”再拔下USB设备。
计算机主机后面板上有电源,POST,串口,并口,显示器,网络,USB,音响与话筒接口,这些接口大部分就是主板上自带的。
声卡,网卡,显卡可以就是主板上集成的设备也可以就是独立的设备。
注:不同的主板接口布局有所不同,但就是接口规格与形式都就是符合国际标准的。
串口:这种接口的数据传送模式就是串行通讯,所以它只能连接串行设备。
并口:这种接口的数据传送模式就是并行通讯,主要与并口设备连接,通常可以与并口打印机相连接。
COM口:COM口有两个,一个COM口就是鼠标接口,一个COM口就是键盘接口,接口的旁边都有标示。
使用电脑鼠标的技巧随着科技的不断发展,电脑成为了现代生活中不可或缺的工具之一。
而在使用电脑时,鼠标作为最主要的输入设备之一,在提高我们的工作效率和舒适度方面起着重要的作用。
本文将为大家介绍一些使用电脑鼠标的技巧,帮助大家更好地利用鼠标完成各种任务。
一、基本操作1. 鼠标左键点击:鼠标左键是最常使用的按键,它通常用于选择、拖拽和点击等操作。
在点击时,要确保光标在所需点击的目标上,然后用手指轻触鼠标左键即可完成点击操作。
2. 鼠标右键点击:鼠标右键通常用于弹出菜单、快捷操作和上下文相关的选项。
在点击时,要确保光标在所需点击的目标上,然后用手指轻触鼠标右键即可弹出相应的菜单或操作选项。
3. 拖拽操作:拖拽操作是指将光标放置在某个可拖放的对象上,按住鼠标左键不松手,然后拖动光标到目标位置并释放鼠标左键。
这种操作常用于移动文件、调整窗口大小等。
二、光标操作1. 移动光标:利用鼠标移动光标时,应注意将手放在鼠标上方,以掌握鼠标的稳定性,然后轻轻移动鼠标,使光标在屏幕上移动。
需要注意的是,鼠标的移动幅度与光标在屏幕上的移动幅度成正比,若需要快速移动光标,可以加快鼠标的移动速度。
2. 选择文本:要选择文本,首先要将光标放置在文本的起始位置,然后按住鼠标左键不松手,拖动光标到文本的结束位置,最后释放鼠标左键。
这样就能够选中所需的文本。
三、滚动操作1. 垂直滚动:当我们在浏览网页或文档时,经常需要上下滚动页面。
在大多数鼠标上,我们可以使用鼠标滚轮来控制垂直滚动。
只需将手指放在滚轮上,向上或向下滚动即可实现对页面的垂直滚动。
2. 水平滚动:对于一些较宽的页面或文档,有时我们还需要进行水平滚动来查看被隐藏的内容。
在某些鼠标上,我们可以按住鼠标滚轮并左右移动来实现水平滚动。
四、其他技巧1. 双击操作:双击操作可用于打开文件、文件夹或启动程序等。
双击即快速连续点击鼠标左键两次,要注意连续的时间间隔不要过长或过短,以免影响效果。
寒假总结(2)鼠标键盘系统的基本操作开通黄钻寒假总结(2)鼠标键盘系统的基本操作using System;using System.Collections.Generic;using ponentModel;using System.Data;using System.Drawing;using System.Linq;using System.Text;using System.Windows.Forms; namespace 鼠标{public partial class Form1 : Form{MessageFilter mf = new MessageFilter();public Form1(){}if (e.Button == MouseButtons.Left){textBox1.Text += "鼠标左击点下";}if (e.Button == MouseButtons.Middle){textBox1.Text += "鼠标中间点下";}if (e.Button == MouseButtons.None){textBox1.Text += "未按鼠标";}}private void Form1_Load(object sender, EventArgs e){//添加消息筛选器以便在向目标传送Windows 消息时监视这些消息Application.AddMessageFilter(mf );}//从窗体中移除一个消息筛选器private void Frm_Main_FormClosing(object sender, FormClosingEventArgs e){//从应用程序的消息泵移除一个消息筛选器Application.RemoveMessageFilter (mf);}//方法一,重写WndProc虚方法,与方法二不可同时存在protected override void WndProc(ref Message m){switch (m.Msg)//判断系统消息的ID号{case 513:MessageBox.Show("单击了鼠标左键!", "系统信息");m.Result = (IntPtr)0;//为了响应消息处理而向Windows 返回的值break;case 516:MessageBox.Show("单击了鼠标右键!", "系统信息");m.Result = (IntPtr)0;//为了响应消息处理而向Windows 返回的值break;default:base.WndProc(ref m);break;}}}//方法二,实现IMessageFilter接口,从而获得Windows消息,与方法一不可同时存在public class MessageFilter : IMessageFilter{public bool PreFilterMessage(ref Message message){switch (message.Msg)//判断系统消息的ID号{case 513:MessageBox.Show("单击了鼠标左键!", "系统信息");return true;case 516:MessageBox.Show("单击了鼠标右键!", "系统信息");return true;default:return false;}}}}using System;using System.Collections.Generic;using ponentModel;using System.Data;using System.Drawing;using System.Linq;using System.Text;using System.Windows.Forms; namespace 鼠标{public partial class Form2 : Form{public Form2(){InitializeComponent();InitializeComponent();pen = new Pen(Color.FromName("black"));//始末画笔graphics = CreateGraphics();//初始画板}private void Form2_Load(object sender, EventArgs e){//获取鼠标形状this.Cursor = new Cursor("1.cur");//自定义鼠标图片bel1.Cursor = Cursors.Arrow;//鼠标放上后为箭头状label2.Cursor = Cursors.Hand;//小手状label3.Cursor = Cursors.Help;//箭头问号组合label4.Cursor = Cursors.IBeam;//I型光标label5.Cursor = Cursors.NoMoveHoriz;label6.Cursor = Cursors.PanNorth;label7.Cursor = new Cursor("1.ico");//自定义图片}private void button1_Click(object sender, EventArgs e){this.Cursor = new Cursor(Cursor.Current.Handle);//创建cursor对象Cursor.Position = new Point(Cursor.Position.X,Cursor.Position.Y);//设置鼠标位置Cursor.Clip = new Rectangle(this.Location, this.Size);//设置鼠标的活动区域}private void button2_Click(object sender, EventArgs e){Screen[] screens = Screen.AllScreens;//获取显示的数组this.Cursor = new Cursor(Cursor.Current.Handle);//创建Cursor对象Cursor.Clip =screens[0].Bounds;//接触对鼠标活动区域的限制}public bool G_OnMouseDown = false;//标识,用来控制画图public Point lastPoint = Point.Empty;//定义绘图开始点public Pen pen;//声明画笔public Graphics graphics;//声明绘图对象private void Form2_MouseMove(object sender, MouseEventArgs e){if (lastPoint.Equals(Point.Empty))//判断绘图开始点是否为空{lastPoint = new Point(e.X, e.Y);//记录鼠标当前位置}if (G_OnMouseDown)//开始绘图{Point cruuPoint = new Point(e.X, e.Y);//获取鼠标当前位置graphics.DrawLine(pen, cruuPoint, lastPoint);//绘图}lastPoint = new Point(e.X, e.Y);//记录鼠标当前位置}private void Form2_MouseUp(object sender, MouseEventArgs e){G_OnMouseDown = false;//开始绘图标识设置为false}private void Form2_MouseDown(object sender, MouseEventArgs e){G_OnMouseDown = true;//开始绘图标识设置为true````}}}using System;using System.Collections.Generic;using ponentModel;using System.Data;using System.Drawing;using System.Linq;using System.Text;using System.Windows.Forms; namespace 键盘{public partial class Form1 : Form{public Form1(){InitializeComponent();}private void textBox1_KeyDown(object sender,KeyEventArgs e){/* if((e.Control ==true )&&(e.KeyCode ==Keys .A )){MessageBox.Show("你按下了ctrl+A", "系统", MessageBoxButtons.OKCancel,MessageB oxIcon .Warning );}*/}private void Form1_Load(object sender, EventArgs e){Form1 f = new Form1();f.KeyPreview = true;}/// <summary>/// 移动窗体/// </summary>/// <paramname="sender"></param>/// <param name="e"></param>private void Form1_KeyDown(object sender, KeyEventArgs e){Point point = this.Location;switch (e.KeyData)//判断按键类型{case Keys .Up :point.Y -= 2;break;case Keys.Down :point.Y += 2;break;case Keys .Right :point.X += 2;break;case Keys.Left :point .X -=2;break;case Keys .Escape :this.Close();break;default: break;}this .Location =point ;}/* private void Form1_KeyDown(object sender, KeyEventArgs e){if (e.Alt && e.KeyCode == Keys.F4)//键值115{e.Handled = true;//不执行操作}if (e.KeyCode== Keys.F1){MessageBox.Show("王延领按下了f1", "提示");}}private void Form1_KeyUp(object sender, KeyEventArgs e){if (e.KeyData == Keys.Escape)//按下esc时{if (MessageBox.Show("是否关闭程序","提示信息", MessageBoxButtons.YesNo) == DialogResult.Yes){Application.Exit();}}}private void richTextBox1_KeyDown(object sender, KeyEventArgs e){if (e.Control && e.KeyCode == Keys.V){e.Handled = true;//屏蔽CRTRL+V}if (e.Control && e.KeyCode == Keys.X||e.KeyCode ==Keys .C ){e.Handled = true;}}private void textBox1_KeyPress(object sender, KeyPressEventArgs e){//释放后发生事件if (e.KeyChar == 13){e.Handled = true;//关闭敲回车键嘀的声音}}/// <summary>/// 输入法的打开与关闭/// </summary>/// <param name="sender"></param>/// <param name="e"></param>private void button1_Click(object sender, EventArgs e){this.textBox1.ImeMode = ImeMode.Off;//关闭输入法}private void button2_Click(object sender, EventArgs e){this.textBox1.ImeMode = ImeMode.On;}private void Form1_Load(object sender, EventArgs e){Form1 f = new Form1();f.KeyPreview = true;//接受案件控件}/* [System.Runtime.InteropService s.DllImport("user32", EntryPoint = "GetKeyState")]//重写Apipublic static extern int GetKeyState(int intkey);private void button1_Click(object sender, EventArgs e){string str = "判断numlockhr capslock键是否锁定:\n";int intnumlock = GetKeyState(144);//判断numlock键if (intnumlock == 0){str += "numlock未锁定\n";}else {str += "numlock已锁定\n";}int intcapslock = GetKeyState(20);if (intcapslock == 0){str += "caplock未锁定\n";}else{str += "caplock已锁定\n";}MessageBox.Show(str, "判断");}private void textBox1_KeyDown_1(object sender, KeyEventArgs e){if (e.KeyValue == 13)//如果键值为13(回车键){SendKeys.Send("{TAB}");//发送TAB命令}}private void textBox2_KeyDown(object sender, KeyEventArgs e){if (e.KeyValue == 13){SendKeys.Send("{TAB}");}}*/}}using System;using System.Collections.Generic;using ponentModel;using System.Data;using System.Drawing;using System.Linq;using System.Text;using System.Windows.Forms; namespace 系统{public partial class Form1 : Form{public Form1(){InitializeComponent();}private void Form1_Load(object sender, EventArgs e){label1.Text = "当前时间是:" + DateTime.Now.ToString();//获取现在时间label2.Text = "当前系统目录" + Environment.SystemDirectory;label3.Text = "计算机名称:" + Environment.MachineName;label4.Text = "当前运行目录:" + Environment.CurrentDirectory;label5.Text = "系统版本号:" + Environment.OSVersion.VersionString;textBox1.Text = (Environment.TickCount / 1000).ToString() + "秒";//获取启动后经过的时间}private void timer1_Tick(object sender, EventArgs e){textBox1.Text = (Environment.TickCount / 1000).ToString() +"秒";}}}using System;using System.Collections.Generic;using ponentModel;using System.Data;using System.Drawing;using System.Linq;using System.Text;using System.Windows.Forms;using System.Collections;namespace 获取系统环境变量{public partial class Form1 : Form{public Form1(){InitializeComponent();}private void Form1_Load(object sender, EventArgs e){listView1.View = View.Details;//设置控件显示方式listView1.GridLines = true;//是否显示网格listView1.Columns.Add("环境变量", 150, HorizontalAlignment.Left);//添加列标头listView1.Columns.Add("变量值", 150, HorizontalAlignment.Left);//添加列标头ListViewItem myItem;//创建ListViewItem对象//获取系统环境变量及对应的变量值,并显示在ListView控件中foreach (DictionaryEntry DEntry inEnvironment.GetEnvironmentVariables()) {myItem = new ListViewItem(DEntry.Key.ToString(), 0);//创建ListViewItem对象myItem.SubItems.Add(DEntry. Value.ToString());//添加子项集合listView1.Items.Add(myItem); //将子项集合添加到控件中}}}}using System;using System.Collections.Generic;using ponentModel;using System.Data;using System.Drawing;using System.Linq;using System.Text;using System.Windows.Forms; namespace 获取所有逻辑分区{public partial class Form1 : Form{public Form1(){InitializeComponent();}private void button1_Click(object sender, EventArgs e){listFolders(comboBox1);}public void listFolders(ComboBox tscb)//获取本地磁盘目录{string[] logicdrives = System.IO.Directory.GetLogicalDrives(); //获取本地逻辑分区的数组for (int i = 0; i <logicdrives.Length; i++)//遍历数组{tscb.Items.Add(logicdrives[i]); //将数组中的项目添加到ComboBox控件中tscb.SelectedIndex = 0;//设置第一项被选中}}private void comboBox1_SelectedIndexChanged(obj ect sender, EventArgs e){try{System.IO.DriveInfo[] drive = System.IO.DriveInfo.GetDrives();//获取所有磁盘驱动for (int i = 0; i < drive.Length; i++)//遍历数组{if (comboBox1.SelectedItem.ToString()== drive[i].Name)//判断遍历到的想是否与下拉框中的项相同{label1.Text = "总空间" + drive[i].TotalSize / 1024 / 1024 / 1024 + "G";label2.Text = "剩余空间" + drive[i].TotalFreeSpace / 1024 / 1024 / 1024 + "G";label3.Text = "已用空间" + (drive[i].TotalSize - drive[i].TotalFreeSpace) / 1024 / 1024 / 1024 + "G";}if (comboBox1.SelectedItem.ToString()== drive[i].Name){if (drive[i].IsReady){textBox1.Text = drive[i].DriveFormat;//判断磁盘类型}}}}catch {}}}}using System;using System.Collections.Generic; using ponentModel; using System.Data;using System.Drawing;using System.Linq;using System.Text;using System.Windows.Forms; using System.IO;namespace 磁盘信息{public partial class Form1 : Form {public Form1(){InitializeComponent();}string str = "";private void Form1_Load(object sender, EventArgs e){DriveInfo[] alldrives = DriveInfo.GetDrives();//获取所有驱动信息foreach (DriveInfo dir in alldrives)//遍历所有驱动信息{str += Environment.NewLine + "驱动名称: " + ;str += Environment.NewLine + "类型: " + dir.DriveType;if (dir.IsReady == true)//判断是否准备好{str += Environment.NewLine + "卷标: " + dir.VolumeLabel;str += Environment.NewLine + "文本格式: " + dir.DriveFormat;str += Environment.NewLine + "可用空间: " + dir.TotalFreeSpace;str += Environment.NewLine + "总空间: " + dir.TotalSize;}}label1.Text = str;}}}。
寒假总结(2)鼠标键盘系统的基本操作开通黄钻寒假总结(2)鼠标键盘系统的基本操作using System;using System.Collections.Generic;using ponentModel;using System.Data;using System.Drawing;using System.Linq;using System.Text;using System.Windows.Forms; namespace 鼠标{public partial class Form1 : Form{MessageFilter mf = new MessageFilter();public Form1(){InitializeComponent();}private void Form1_MouseDown(object sender, MouseEventArgs e){//获取鼠标点击时位置XY坐标bel1.Text = e.X.ToString();bel2.Text = e.Y.ToString();}private void textBox1_MouseDown(object sender, MouseEventArgs e){//获取鼠标操作操作string str = textBox1.Text;if (e.Button == MouseButtons.Right){textBox1.Text += "鼠标右击点下";}if (e.Button ==MouseButtons.Left){textBox1.Text += "鼠标左击点下";}if (e.Button == MouseButtons.Middle){textBox1.Text += "鼠标中间点下";}if (e.Button == MouseButtons.None){textBox1.Text += "未按鼠标";}}private void Form1_Load(object sender, EventArgs e){//添加消息筛选器以便在向目标传送Windows 消息时监视这些消息Application.AddMessageFilter(mf );}//从窗体中移除一个消息筛选器private void Frm_Main_FormClosing(object sender, FormClosingEventArgs e){//从应用程序的消息泵移除一个消息筛选器Application.RemoveMessageFilter (mf);}//方法一,重写WndProc虚方法,与方法二不可同时存在protected override void WndProc(ref Message m){switch (m.Msg)//判断系统消息的ID号{case 513:MessageBox.Show("单击了鼠标左键!", "系统信息");m.Result = (IntPtr)0;//为了响应消息处理而向Windows 返回的值break;case 516:MessageBox.Show("单击了鼠标右键!", "系统信息");m.Result = (IntPtr)0;//为了响应消息处理而向Windows 返回的值break;default:base.WndProc(ref m);break;}}}//方法二,实现IMessageFilter接口,从而获得Windows消息,与方法一不可同时存在public class MessageFilter : IMessageFilter{public bool PreFilterMessage(ref Message message){switch (message.Msg)//判断系统消息的ID号{case 513:MessageBox.Show("单击了鼠标左键!", "系统信息");return true;case 516:MessageBox.Show("单击了鼠标右键!", "系统信息");return true;default:return false;}}}}using System;using System.Collections.Generic;using ponentModel;using System.Data;using System.Drawing;using System.Linq;using System.Text;using System.Windows.Forms; namespace 鼠标{public partial class Form2 : Form{public Form2(){InitializeComponent();InitializeComponent();pen = new Pen(Color.FromName("black"));//始末画笔graphics = CreateGraphics();//初始画板}private void Form2_Load(object sender, EventArgs e){//获取鼠标形状this.Cursor = new Cursor("1.cur");//自定义鼠标图片bel1.Cursor = Cursors.Arrow;//鼠标放上后为箭头状label2.Cursor = Cursors.Hand;//小手状label3.Cursor = Cursors.Help;//箭头问号组合label4.Cursor = Cursors.IBeam;//I型光标label5.Cursor = Cursors.NoMoveHoriz;label6.Cursor = Cursors.PanNorth;label7.Cursor = new Cursor("1.ico");//自定义图片}private void button1_Click(object sender, EventArgs e){this.Cursor = new Cursor(Cursor.Current.Handle);//创建cursor对象Cursor.Position = new Point(Cursor.Position.X,Cursor.Position.Y);//设置鼠标位置Cursor.Clip = new Rectangle(this.Location, this.Size);//设置鼠标的活动区域}private void button2_Click(object sender, EventArgs e){Screen[] screens = Screen.AllScreens;//获取显示的数组this.Cursor = new Cursor(Cursor.Current.Handle);//创建Cursor对象Cursor.Clip = screens[0].Bounds;//接触对鼠标活动区域的限制}public bool G_OnMouseDown = false;//标识,用来控制画图public Point lastPoint = Point.Empty;//定义绘图开始点public Pen pen;//声明画笔public Graphics graphics;//声明绘图对象private void Form2_MouseMove(object sender, MouseEventArgs e){if (lastPoint.Equals(Point.Empty))//判断绘图开始点是否为空{lastPoint = new Point(e.X, e.Y);//记录鼠标当前位置}if (G_OnMouseDown)//开始绘图{Point cruuPoint = new Point(e.X, e.Y);//获取鼠标当前位置graphics.DrawLine(pen, cruuPoint, lastPoint);//绘图}lastPoint = new Point(e.X, e.Y);//记录鼠标当前位置}private void Form2_MouseUp(object sender, MouseEventArgs e){G_OnMouseDown = false;//开始绘图标识设置为false}private void Form2_MouseDown(object sender, MouseEventArgs e){G_OnMouseDown = true;//开始绘图标识设置为true````}}}using System;using System.Collections.Generic;using ponentModel;using System.Data;using System.Drawing;using System.Linq;using System.Text;using System.Windows.Forms; namespace 键盘{public partial class Form1 : Form{public Form1(){InitializeComponent();}private void textBox1_KeyDown(object sender, KeyEventArgs e){/* if((e.Control ==true )&&(e.KeyCode ==Keys .A )){MessageBox.Show("你按下了ctrl+A", "系统", MessageBoxButtons.OKCancel,MessageB oxIcon .Warning );}*/}private void Form1_Load(object sender, EventArgs e){Form1 f = new Form1();f.KeyPreview = true;}/// <summary>/// 移动窗体/// </summary>/// <param name="sender"></param>/// <param name="e"></param>private void Form1_KeyDown(object sender,KeyEventArgs e){Point point = this.Location;switch (e.KeyData)//判断按键类型{case Keys .Up :point.Y -= 2;break;case Keys.Down :point.Y += 2;break;case Keys .Right :point.X += 2;break;case Keys.Left :point .X -=2;break;case Keys .Escape :this.Close();break;default: break;}this .Location =point ;}/* private void Form1_KeyDown(object sender, KeyEventArgs e){if (e.Alt && e.KeyCode == Keys.F4)//键值115{e.Handled = true;//不执行操作}if (e.KeyCode== Keys.F1){MessageBox.Show("王延领按下了f1", "提示");}}private void Form1_KeyUp(object sender, KeyEventArgs e){if (e.KeyData == Keys.Escape)//按下esc时{if (MessageBox.Show("是否关闭程序","提示信息", MessageBoxButtons.YesNo) == DialogResult.Yes){Application.Exit();}}}private void richTextBox1_KeyDown(object sender, KeyEventArgs e){if (e.Control && e.KeyCode == Keys.V){e.Handled = true;//屏蔽CRTRL+V}if (e.Control && e.KeyCode == Keys.X||e.KeyCode ==Keys .C ){e.Handled = true;}}private void textBox1_KeyPress(object sender, KeyPressEventArgs e){//释放后发生事件if (e.KeyChar == 13){e.Handled = true;//关闭敲回车键嘀的声音}}/// <summary>/// 输入法的打开与关闭/// </summary>/// <param name="sender"></param>/// <param name="e"></param>private void button1_Click(object sender, EventArgs e){this.textBox1.ImeMode = ImeMode.Off;//关闭输入法}private void button2_Click(object sender, EventArgs e){this.textBox1.ImeMode = ImeMode.On;}private void Form1_Load(object sender, EventArgs e){Form1 f = new Form1();f.KeyPreview = true;//接受案件控件}/* [System.Runtime.InteropService s.DllImport("user32", EntryPoint = "GetKeyState")]//重写Apipublic static extern int GetKeyState(int intkey);private void button1_Click(object sender, EventArgs e){string str = "判断numlockhr capslock键是否锁定:\n";int intnumlock = GetKeyState(144);//判断numlock键if (intnumlock == 0){str += "numlock未锁定\n";}else {str += "numlock已锁定\n";}int intcapslock = GetKeyState(20);if (intcapslock == 0){str += "caplock未锁定\n";}else{str += "caplock已锁定\n";}MessageBox.Show(str, "判断");}private void textBox1_KeyDown_1(object sender, KeyEventArgs e){if (e.KeyValue == 13)//如果键值为13(回车键){SendKeys.Send("{TAB}");//发送TAB命令}}private void textBox2_KeyDown(object sender, KeyEventArgs e){if (e.KeyValue == 13){SendKeys.Send("{TAB}");}}*/}}using System;using System.Collections.Generic; using ponentModel; using System.Data;using System.Drawing;using System.Linq;using System.Text;using System.Windows.Forms; namespace 系统{public partial class Form1 : Form {public Form1(){InitializeComponent();}private void Form1_Load(object sender, EventArgs e){label1.Text = "当前时间是:" + DateTime.Now.ToString();//获取现在时间label2.Text = "当前系统目录" + Environment.SystemDirectory;label3.Text = "计算机名称:" + Environment.MachineName;label4.Text = "当前运行目录:" + Environment.CurrentDirectory;label5.Text = "系统版本号:" + Environment.OSVersion.VersionString;textBox1.Text = (Environment.TickCount / 1000).ToString() + "秒";//获取启动后经过的时间}private void timer1_Tick(object sender, EventArgs e){textBox1.Text = (Environment.TickCount / 1000).ToString() +"秒";}}}using System;using System.Collections.Generic;using ponentModel;using System.Data;using System.Drawing;using System.Linq;using System.Text;using System.Windows.Forms;using System.Collections;namespace 获取系统环境变量{public partial class Form1 : Form{public Form1(){InitializeComponent();}private void Form1_Load(object sender, EventArgs e){listView1.View = View.Details;//设置控件显示方式listView1.GridLines = true;//是否显示网格listView1.Columns.Add("环境变量", 150, HorizontalAlignment.Left);//添加列标头listView1.Columns.Add("变量值", 150, HorizontalAlignment.Left);//添加列标头ListViewItem myItem;//创建ListViewItem对象//获取系统环境变量及对应的变量值,并显示在ListView控件中foreach (DictionaryEntry DEntry inEnvironment.GetEnvironmentVariables()){myItem = new ListViewItem(DEntry.Key.ToString(), 0);//创建ListViewItem对象myItem.SubItems.Add(DEntry. Value.ToString());//添加子项集合listView1.Items.Add(myItem); //将子项集合添加到控件中}}}}using System;using System.Collections.Generic;using ponentModel;using System.Data;using System.Drawing;using System.Linq;using System.Text;using System.Windows.Forms; namespace 获取所有逻辑分区{public partial class Form1 : Form{public Form1(){InitializeComponent();}private void button1_Click(object sender, EventArgs e){listFolders(comboBox1);}public void listFolders(ComboBox tscb)//获取本地磁盘目录{string[] logicdrives = System.IO.Directory.GetLogicalDrives(); //获取本地逻辑分区的数组for (int i = 0; i < logicdrives.Length; i++)//遍历数组{tscb.Items.Add(logicdrives[i]); //将数组中的项目添加到ComboBox控件中tscb.SelectedIndex = 0;//设置第一项被选中}}private void comboBox1_SelectedIndexChanged(obj ect sender, EventArgs e){try{System.IO.DriveInfo[] drive = System.IO.DriveInfo.GetDrives();//获取所有磁盘驱动for (int i = 0; i < drive.Length; i++)//遍历数组{if (comboBox1.SelectedItem.ToString()== drive[i].Name)//判断遍历到的想是否与下拉框中的项相同{label1.Text = "总空间" +drive[i].TotalSize / 1024 / 1024 / 1024 + "G";label2.Text = "剩余空间" + drive[i].TotalFreeSpace / 1024 / 1024 / 1024 + "G";label3.Text = "已用空间" + (drive[i].TotalSize - drive[i].TotalFreeSpace) / 1024 / 1024 / 1024 + "G";}if (comboBox1.SelectedItem.ToString()== drive[i].Name){if (drive[i].IsReady){textBox1.Text = drive[i].DriveFormat;//判断磁盘类型}}}}catch {}}}}using System;using System.Collections.Generic; using ponentModel; using System.Data;using System.Drawing;using System.Linq;using System.Text;using System.Windows.Forms; using System.IO;namespace 磁盘信息{public partial class Form1 : Form {public Form1(){InitializeComponent();}string str = "";private void Form1_Load(object sender, EventArgs e){DriveInfo[] alldrives = DriveInfo.GetDrives();//获取所有驱动信息foreach (DriveInfo dir in alldrives)//遍历所有驱动信息{str += Environment.NewLine + "驱动名称: " + ;str += Environment.NewLine + "类型: " + dir.DriveType;if (dir.IsReady == true)//判断是否准备好{str += Environment.NewLine + "卷标: " + dir.VolumeLabel;str += Environment.NewLine + "文本格式: " + dir.DriveFormat;str += Environment.NewLine+ "可用空间: " + dir.TotalFreeSpace;str += Environment.NewLine + "总空间: " + dir.TotalSize;}}label1.Text = str;}}}。