资源简介
文件是用c#,winform 写的一个扫雷游戏,基本功能都可以实现,支持用户的自定义设置
代码片段和文件信息
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using ClearMine.Properties;
using System.IO;
namespace ClearMine
{
public partial class Form1 : Form
{
int[] mi;//地雷位置
List red;//红旗位置
int mine = 40;//地雷数
int column = 16;//表格列数
int row = 16;//表格行数
int cli=0;//点击的次数
List milist;
List miclist;
IDictionary miDic;
DateTime dt = DateTime.Now;
bool over = false;
public Form1()
{
InitializeComponent();
}
//鼠标点击事件
private void bt_MouseDown(object sender MouseEventArgs e)
{
if (!over)
{
miclist = new List();
milist = new List();
Button bt = (Button)sender;
if (bt.Name.Contains(“mine“))
{
int celnum = Convert.ToInt32(bt.Name.Remove(0 4));
if (e.Button == MouseButtons.Right)
{
if (bt.BackColor != Color.Silver)
{
if (cli == 0)
{
dt = DateTime.Now;
this.timer.Start();
}
if (!red.Contains(celnum))
{
cli += 1;
if (this.lab_redflag.Text == “0“)
{
MessageBox.Show(“你的红旗已用完!“);
}
else
{
bt.BackColor = Color.Silver;
bt.BackgroundImage = Properties.Resources.redflag;
bt.BackgroundImageLayout = ImageLayout.Zoom;
red.Add(celnum);
lab_redflag.Text = (Convert.ToInt32(lab_redflag.Text) - 1).ToString();
if (red.Count == mine&&cli==row*column)
{
int count = 0;
foreach (int i in red)
{
if (mi.Contains(i))
{
count++;
}
else
{
break;
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 1894 2015-01-26 15:30 ClearMine\ClearMine\bin\Debug\ClearMine.application
文件 50688 2015-01-26 15:30 ClearMine\ClearMine\bin\Debug\ClearMine.exe
文件 3759 2015-01-26 15:30 ClearMine\ClearMine\bin\Debug\ClearMine.exe.manifest
文件 38400 2015-01-26 15:30 ClearMine\ClearMine\bin\Debug\ClearMine.pdb
文件 1894 2015-01-26 15:30 ClearMine\ClearMine\bin\Debug\ClearMine.vshost.application
文件 11600 2015-01-26 15:30 ClearMine\ClearMine\bin\Debug\ClearMine.vshost.exe
文件 3759 2015-01-26 15:30 ClearMine\ClearMine\bin\Debug\ClearMine.vshost.exe.manifest
文件 66560 2015-01-27 15:44 ClearMine\ClearMine\bin\Release\app.publish\Application Files\ClearMine_1_0_0_4\ClearMine.exe.deploy
文件 4588 2015-01-27 15:44 ClearMine\ClearMine\bin\Release\app.publish\Application Files\ClearMine_1_0_0_4\ClearMine.exe.manifest
文件 7358 2015-01-27 15:35 ClearMine\ClearMine\bin\Release\app.publish\Application Files\ClearMine_1_0_0_4\mine.ico.deploy
文件 8482 2015-01-22 10:36 ClearMine\ClearMine\bin\Release\app.publish\Application Files\ClearMine_1_0_0_4\png\mine.png.deploy
文件 3858 2015-01-26 15:41 ClearMine\ClearMine\bin\Release\app.publish\Application Files\ClearMine_1_0_0_4\png\minegif.gif.deploy
文件 14555 2015-01-22 10:36 ClearMine\ClearMine\bin\Release\app.publish\Application Files\ClearMine_1_0_0_4\png\redflag.png.deploy
文件 1933 2015-01-27 15:44 ClearMine\ClearMine\bin\Release\app.publish\ClearMine.application
文件 430592 2015-01-27 15:44 ClearMine\ClearMine\bin\Release\app.publish\setup.exe
文件 1897 2015-01-29 10:17 ClearMine\ClearMine\bin\Release\ClearMine.application
文件 66048 2015-01-29 10:17 ClearMine\ClearMine\bin\Release\ClearMine.exe
文件 4588 2015-01-29 10:17 ClearMine\ClearMine\bin\Release\ClearMine.exe.manifest
文件 38400 2015-01-29 10:17 ClearMine\ClearMine\bin\Release\ClearMine.pdb
文件 1897 2015-01-29 10:17 ClearMine\ClearMine\bin\Release\ClearMine.vshost.application
文件 11600 2015-01-29 10:17 ClearMine\ClearMine\bin\Release\ClearMine.vshost.exe
文件 4588 2015-01-29 10:17 ClearMine\ClearMine\bin\Release\ClearMine.vshost.exe.manifest
文件 92 2015-01-29 10:18 ClearMine\ClearMine\bin\Release\log\ClearMineLog.txt
文件 6340 2015-01-27 17:04 ClearMine\ClearMine\ClearMine.csproj
文件 477 2015-01-27 15:38 ClearMine\ClearMine\ClearMine.csproj.user
文件 1724 2015-01-26 15:21 ClearMine\ClearMine\ClearMine_TemporaryKey.pfx
文件 25183 2015-01-29 10:17 ClearMine\ClearMine\Form1.cs
文件 19530 2015-01-29 10:17 ClearMine\ClearMine\Form1.Designer.cs
文件 6209 2015-01-29 10:17 ClearMine\ClearMine\Form1.resx
文件 7358 2015-01-27 15:35 ClearMine\ClearMine\mine.ico
............此处省略56个文件信息
- 上一篇:基于C#的简单抄表界面
- 下一篇:powll优化设计鲍威尔法
评论
共有 条评论