资源简介
幸运52 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 System.Drawing.Imaging;
namespace Lucky52
{
public partial class Form1 : Form
{
int num;
int pn1=10; string name;
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender EventArgs e)
{
timer2.Enabled = true;
timer1.Enabled = true;
label3.Text = null;
label4.Text = ““;
textBox1.Enabled = true;
button2.Enabled = true;
button3.Enabled = true;
n1 = 10;
}
private void button2_Click(object sender EventArgs e)
{
label3.Text = null;
int guessp=int.Parse (textBox1.Text);
if(guessp==p)
{
label3.Text=“太棒了,你猜的完全正确“;
label4.Text=p+name+“\n“;
}
else if(guessp!=p)
label3.Text+=“你猜错了“;
}
private void Form1_Load(object sender EventArgs e)
{
}
private void timer1_Tick(object sender EventArgs e)
{
label5.Text = “剩余时间:“ + n1;
if (n1 == 0)
{
timer2.Enabled = false;
label5.Text = “时间到了!“;
button4.Visible = true;
}
}
private void timer2_Tick(object sender EventArgs e)
{
n1--;
Random rand = new Random();
num = rand.Next(0 8);
//string str =
//str += num.ToString() + “.jpg“;
// pictureBox1.Image = Image.FromFile(str);
switch (num)
{
case 0: p = 100; name = “衬衣“;
break;
case 1: p = 10; name = “葡萄“;
break;
case 2: p = 8; name = “香蕉“;
break;
case 3: p = 5000; name = “劳力士“;
break;
case 4: p = 10000; name = “大炮“;
break;
case 5: p = 100000; name = “汽车“;
break;
case 6: p = 800; name = “茅台“;
break;
case 7: p = 1; name = “草莓“;
break;
default: p = 2; name = “凤梨“;
break;
}
pictureBox1 .Image =imageList1 .Images [num];
}
private void button3_Click(object sender EventArgs e)
{
timer2.Enabled = false;
}
private void button4_Click(object sender EventArgs e)
{
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 377856 2011-01-27 10:20 幸运52\Lucky52\Lucky52\bin\Debug\Lucky52.exe
文件 34304 2011-01-27 10:20 幸运52\Lucky52\Lucky52\bin\Debug\Lucky52.pdb
文件 14328 2011-01-27 10:20 幸运52\Lucky52\Lucky52\bin\Debug\Lucky52.vshost.exe
文件 490 2009-06-11 05:14 幸运52\Lucky52\Lucky52\bin\Debug\Lucky52.vshost.exe.manifest
目录 0 2012-05-21 09:43 幸运52\Lucky52\Lucky52\bin\Debug
目录 0 2012-05-21 09:43 幸运52\Lucky52\Lucky52\bin
文件 1 2010-12-09 16:32 幸运52\Lucky52\Lucky52\ClassDiagram1.cd
文件 1 2010-12-10 21:09 幸运52\Lucky52\Lucky52\ClassDiagram2.cd
文件 4518 2010-12-12 22:31 幸运52\Lucky52\Lucky52\Form1.cs
文件 15171 2010-12-12 22:31 幸运52\Lucky52\Lucky52\Form1.Designer.cs
文件 542523 2010-12-12 22:31 幸运52\Lucky52\Lucky52\Form1.resx
文件 540 2011-01-27 10:20 幸运52\Lucky52\Lucky52\Form2.cs
文件 2284 2010-12-09 15:41 幸运52\Lucky52\Lucky52\Form2.Designer.cs
文件 12289 2010-12-09 15:41 幸运52\Lucky52\Lucky52\Form2.resx
文件 4140 2010-12-10 21:23 幸运52\Lucky52\Lucky52\Lucky52.csproj
文件 2661 2011-01-27 10:20 幸运52\Lucky52\Lucky52\obj\Debug\Lucky52.csproj.FileListAbsolute.txt
文件 905 2010-12-12 22:31 幸运52\Lucky52\Lucky52\obj\Debug\Lucky52.csproj.GenerateResource.Cache
文件 377856 2011-01-27 10:20 幸运52\Lucky52\Lucky52\obj\Debug\Lucky52.exe
文件 357797 2010-12-12 22:31 幸运52\Lucky52\Lucky52\obj\Debug\Lucky52.Form1.resources
文件 4609 2010-12-10 21:23 幸运52\Lucky52\Lucky52\obj\Debug\Lucky52.Form2.resources
文件 34304 2011-01-27 10:20 幸运52\Lucky52\Lucky52\obj\Debug\Lucky52.pdb
文件 180 2010-12-10 21:23 幸运52\Lucky52\Lucky52\obj\Debug\Lucky52.Properties.Resources.resources
目录 0 2012-05-21 09:43 幸运52\Lucky52\Lucky52\obj\Debug\Refactor
目录 0 2012-05-21 09:43 幸运52\Lucky52\Lucky52\obj\Debug\TempPE
目录 0 2012-05-21 09:43 幸运52\Lucky52\Lucky52\obj\Debug
目录 0 2012-05-21 09:43 幸运52\Lucky52\Lucky52\obj
文件 488 2010-12-10 20:54 幸运52\Lucky52\Lucky52\Program.cs
文件 1370 2010-12-09 13:42 幸运52\Lucky52\Lucky52\Properties\AssemblyInfo.cs
文件 2864 2010-12-09 13:42 幸运52\Lucky52\Lucky52\Properties\Resources.Designer.cs
文件 5612 2010-12-09 13:42 幸运52\Lucky52\Lucky52\Properties\Resources.resx
............此处省略22个文件信息
- 上一篇:C# SFTP文件上传和,有进度条,增加多个文件文件
- 下一篇:WPF漂亮倒计时界面
评论
共有 条评论