⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 highsocre.cs

📁 C#制作的经典游戏:数字拼图 提供源代码参考
💻 CS
字号:
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;

namespace NumPuzzle
{
	/// <summary>
	/// HighSocre 的摘要说明。
	/// </summary>
	public class HighSocre : System.Windows.Forms.Form
	{
		private System.Windows.Forms.Label label1;
		private System.Windows.Forms.Label label2;
		private System.Windows.Forms.Label label3;
		private System.Windows.Forms.Label label4;
		private System.Windows.Forms.Label label5;
		private System.Windows.Forms.Label label6;
		private System.Windows.Forms.Label label7;
		private System.Windows.Forms.Button button1;
		private System.Windows.Forms.Label label16;
		private System.Windows.Forms.Label e_player;
		private System.Windows.Forms.Label n_player;
		private System.Windows.Forms.Label h_player;
		private System.Windows.Forms.Label b_player;
		private System.Windows.Forms.Label e_move;
		private System.Windows.Forms.Label n_move;
		private System.Windows.Forms.Label h_move;
		private System.Windows.Forms.Label b_move;
		/// <summary>
		/// 必需的设计器变量。
		/// </summary>
		private System.ComponentModel.Container components = null;

		public HighSocre()
		{
			//
			// Windows 窗体设计器支持所必需的
			//
			InitializeComponent();

			//
			// TODO: 在 InitializeComponent 调用后添加任何构造函数代码
			//
		}

		/// <summary>
		/// 清理所有正在使用的资源。
		/// </summary>
		protected override void Dispose( bool disposing )
		{
			if( disposing )
			{
				if(components != null)
				{
					components.Dispose();
				}
			}
			base.Dispose( disposing );
		}

		#region Windows 窗体设计器生成的代码
		/// <summary>
		/// 设计器支持所需的方法 - 不要使用代码编辑器修改
		/// 此方法的内容。
		/// </summary>
		private void InitializeComponent()
		{
			this.label1 = new System.Windows.Forms.Label();
			this.label2 = new System.Windows.Forms.Label();
			this.label3 = new System.Windows.Forms.Label();
			this.label4 = new System.Windows.Forms.Label();
			this.label5 = new System.Windows.Forms.Label();
			this.label6 = new System.Windows.Forms.Label();
			this.label7 = new System.Windows.Forms.Label();
			this.e_player = new System.Windows.Forms.Label();
			this.n_player = new System.Windows.Forms.Label();
			this.h_player = new System.Windows.Forms.Label();
			this.b_player = new System.Windows.Forms.Label();
			this.e_move = new System.Windows.Forms.Label();
			this.n_move = new System.Windows.Forms.Label();
			this.h_move = new System.Windows.Forms.Label();
			this.b_move = new System.Windows.Forms.Label();
			this.button1 = new System.Windows.Forms.Button();
			this.label16 = new System.Windows.Forms.Label();
			this.SuspendLayout();
			// 
			// label1
			// 
			this.label1.Location = new System.Drawing.Point(32, 32);
			this.label1.Name = "label1";
			this.label1.Size = new System.Drawing.Size(72, 16);
			this.label1.TabIndex = 0;
			this.label1.Text = "Game Diff";
			// 
			// label2
			// 
			this.label2.Location = new System.Drawing.Point(144, 32);
			this.label2.Name = "label2";
			this.label2.Size = new System.Drawing.Size(56, 16);
			this.label2.TabIndex = 1;
			this.label2.Text = "Player";
			// 
			// label3
			// 
			this.label3.Location = new System.Drawing.Point(240, 32);
			this.label3.Name = "label3";
			this.label3.Size = new System.Drawing.Size(64, 16);
			this.label3.TabIndex = 2;
			this.label3.Text = "MoveMent";
			// 
			// label4
			// 
			this.label4.Location = new System.Drawing.Point(32, 64);
			this.label4.Name = "label4";
			this.label4.Size = new System.Drawing.Size(72, 16);
			this.label4.TabIndex = 3;
			this.label4.Text = "Easy:";
			// 
			// label5
			// 
			this.label5.Location = new System.Drawing.Point(32, 96);
			this.label5.Name = "label5";
			this.label5.Size = new System.Drawing.Size(72, 16);
			this.label5.TabIndex = 4;
			this.label5.Text = "Normal:";
			// 
			// label6
			// 
			this.label6.Location = new System.Drawing.Point(32, 128);
			this.label6.Name = "label6";
			this.label6.Size = new System.Drawing.Size(56, 16);
			this.label6.TabIndex = 5;
			this.label6.Text = "Hard:";
			// 
			// label7
			// 
			this.label7.Location = new System.Drawing.Point(32, 160);
			this.label7.Name = "label7";
			this.label7.Size = new System.Drawing.Size(56, 16);
			this.label7.TabIndex = 6;
			this.label7.Text = "BT:";
			// 
			// e_player
			// 
			this.e_player.Location = new System.Drawing.Point(120, 64);
			this.e_player.Name = "e_player";
			this.e_player.Size = new System.Drawing.Size(112, 16);
			this.e_player.TabIndex = 7;
			this.e_player.Text = "-";
			this.e_player.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
			// 
			// n_player
			// 
			this.n_player.Location = new System.Drawing.Point(120, 96);
			this.n_player.Name = "n_player";
			this.n_player.Size = new System.Drawing.Size(112, 16);
			this.n_player.TabIndex = 8;
			this.n_player.Text = "-";
			this.n_player.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
			// 
			// h_player
			// 
			this.h_player.Location = new System.Drawing.Point(120, 127);
			this.h_player.Name = "h_player";
			this.h_player.Size = new System.Drawing.Size(112, 16);
			this.h_player.TabIndex = 9;
			this.h_player.Text = "-";
			this.h_player.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
			// 
			// b_player
			// 
			this.b_player.Location = new System.Drawing.Point(120, 160);
			this.b_player.Name = "b_player";
			this.b_player.Size = new System.Drawing.Size(112, 16);
			this.b_player.TabIndex = 10;
			this.b_player.Text = "-";
			this.b_player.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
			// 
			// e_move
			// 
			this.e_move.Location = new System.Drawing.Point(256, 64);
			this.e_move.Name = "e_move";
			this.e_move.Size = new System.Drawing.Size(48, 16);
			this.e_move.TabIndex = 11;
			this.e_move.Text = "-";
			// 
			// n_move
			// 
			this.n_move.Location = new System.Drawing.Point(256, 96);
			this.n_move.Name = "n_move";
			this.n_move.Size = new System.Drawing.Size(48, 16);
			this.n_move.TabIndex = 12;
			this.n_move.Text = "-";
			// 
			// h_move
			// 
			this.h_move.Location = new System.Drawing.Point(256, 128);
			this.h_move.Name = "h_move";
			this.h_move.Size = new System.Drawing.Size(48, 16);
			this.h_move.TabIndex = 13;
			this.h_move.Text = "-";
			// 
			// b_move
			// 
			this.b_move.Location = new System.Drawing.Point(256, 160);
			this.b_move.Name = "b_move";
			this.b_move.Size = new System.Drawing.Size(48, 16);
			this.b_move.TabIndex = 14;
			this.b_move.Text = "-";
			// 
			// button1
			// 
			this.button1.DialogResult = System.Windows.Forms.DialogResult.OK;
			this.button1.Location = new System.Drawing.Point(136, 232);
			this.button1.Name = "button1";
			this.button1.Size = new System.Drawing.Size(72, 24);
			this.button1.TabIndex = 15;
			this.button1.Text = "OK";
			// 
			// label16
			// 
			this.label16.Location = new System.Drawing.Point(40, 208);
			this.label16.Name = "label16";
			this.label16.Size = new System.Drawing.Size(264, 16);
			this.label16.TabIndex = 16;
			this.label16.Text = "Are You In There?  ^_^  Code By Red_angelX";
			// 
			// HighSocre
			// 
			this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
			this.ClientSize = new System.Drawing.Size(338, 270);
			this.Controls.Add(this.label16);
			this.Controls.Add(this.button1);
			this.Controls.Add(this.b_move);
			this.Controls.Add(this.h_move);
			this.Controls.Add(this.n_move);
			this.Controls.Add(this.e_move);
			this.Controls.Add(this.b_player);
			this.Controls.Add(this.h_player);
			this.Controls.Add(this.n_player);
			this.Controls.Add(this.e_player);
			this.Controls.Add(this.label7);
			this.Controls.Add(this.label6);
			this.Controls.Add(this.label5);
			this.Controls.Add(this.label4);
			this.Controls.Add(this.label3);
			this.Controls.Add(this.label2);
			this.Controls.Add(this.label1);
			this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow;
			this.Name = "HighSocre";
			this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
			this.Text = "HighSocre Top";
			this.Load += new System.EventHandler(this.HighSocre_Load);
			this.ResumeLayout(false);

		}
		#endregion

		private void HighSocre_Load(object sender, System.EventArgs e)
		{
			try
			{
				if(System.IO.File.Exists("NumPuzzlePlayer") == false)
					return;

				System.IO.StreamReader sr = new System.IO.StreamReader("NumPuzzlePlayer",System.Text.Encoding.Default);
				string temp = sr.ReadToEnd();
				sr.Close();

				int e_index=-1;
				int n_index=-1;
				int h_index=-1;
				int b_index=-1;
				char[] dela = "\r\n".ToCharArray();
				string[] temps = temp.Split(dela);
				for(int i=0;i<temps.Length;i++)
				{
					if(temps[i] != "")
					{
						string[] record = temps[i].Split('\t');
						if(record.Length == 3)
						{
							switch(int.Parse(record[2]))
							{
								case 3:
									if(e_index == -1)
									{
										e_index = i;
									}
									else
									{
										if(int.Parse(record[1]) < int.Parse(temps[e_index].Split('\t')[1]))
										{
											e_index = i;
										}
									}
									break;
								case 4:
									if(n_index == -1)
									{
										n_index = i;
									}
									else
									{
										if(int.Parse(record[1]) < int.Parse(temps[n_index].Split('\t')[1]))
										{
											n_index = i;
										}
									}
									break;
								case 5:
									if(h_index == -1)
									{
										h_index = i;
									}
									else
									{
										if(int.Parse(record[1]) < int.Parse(temps[h_index].Split('\t')[1]))
										{
											h_index = i;
										}
									}
									break;
								case 6:
									if(b_index == -1)
									{
										b_index = i;
									}
									else
									{
										if(int.Parse(record[1]) < int.Parse(temps[b_index].Split('\t')[1]))
										{
											b_index = i;
										}
									}
									break;
							} // END SWITCH

						}
					}
				}// END FOR
				if(e_index != -1)
				{
					this.e_player.Text = temps[e_index].Split('\t')[0];
					this.e_move.Text = temps[e_index].Split('\t')[1];
				}
				if(n_index != -1)
				{
					this.n_player.Text = temps[n_index].Split('\t')[0];
					this.n_move.Text = temps[n_index].Split('\t')[1];
				}
				if(h_index != -1)
				{
					this.h_player.Text = temps[h_index].Split('\t')[0];
					this.h_move.Text = temps[h_index].Split('\t')[1];
				}
				if(b_index != -1)
				{
					this.b_player.Text = temps[b_index].Split('\t')[0];
					this.b_move.Text = temps[b_index].Split('\t')[1];
				}
			}
			catch(Exception)
			{
			}
		}


	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -