📄 form_connactus.cs
字号:
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
namespace 图书管理系统
{
/// <summary>
/// Form_ConnactUs 的摘要说明。
/// </summary>
public class Form_ConnactUs : System.Windows.Forms.Form
{
private System.Windows.Forms.Label label2;
private System.Windows.Forms.PictureBox pictureBox1;
private System.Windows.Forms.LinkLabel linkLabel1;
private System.Windows.Forms.TextBox textBox1;
private System.Windows.Forms.Timer timer1;
private System.ComponentModel.IContainer components;
public Form_ConnactUs()
{
//
// 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.components = new System.ComponentModel.Container();
System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(Form_ConnactUs));
this.label2 = new System.Windows.Forms.Label();
this.pictureBox1 = new System.Windows.Forms.PictureBox();
this.linkLabel1 = new System.Windows.Forms.LinkLabel();
this.textBox1 = new System.Windows.Forms.TextBox();
this.timer1 = new System.Windows.Forms.Timer(this.components);
this.SuspendLayout();
//
// label2
//
this.label2.BackColor = System.Drawing.Color.Transparent;
this.label2.Font = new System.Drawing.Font("隶书", 26.25F, System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
this.label2.Location = new System.Drawing.Point(16, 280);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(440, 56);
this.label2.TabIndex = 3;
this.label2.Text = "诚 信 至 上";
this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// pictureBox1
//
this.pictureBox1.Image = ((System.Drawing.Image)(resources.GetObject("pictureBox1.Image")));
this.pictureBox1.Location = new System.Drawing.Point(20, 24);
this.pictureBox1.Name = "pictureBox1";
this.pictureBox1.Size = new System.Drawing.Size(432, 248);
this.pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;
this.pictureBox1.TabIndex = 2;
this.pictureBox1.TabStop = false;
this.pictureBox1.DoubleClick += new System.EventHandler(this.pictureBox1_DoubleClick);
//
// linkLabel1
//
this.linkLabel1.BackColor = System.Drawing.Color.Transparent;
this.linkLabel1.LinkColor = System.Drawing.Color.Red;
this.linkLabel1.Location = new System.Drawing.Point(360, 352);
this.linkLabel1.Name = "linkLabel1";
this.linkLabel1.Size = new System.Drawing.Size(104, 16);
this.linkLabel1.TabIndex = 4;
this.linkLabel1.TabStop = true;
this.linkLabel1.Text = "连接到我们的主页";
this.linkLabel1.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.linkLabel1_LinkClicked);
//
// textBox1
//
this.textBox1.Location = new System.Drawing.Point(24, 248);
this.textBox1.Name = "textBox1";
this.textBox1.Size = new System.Drawing.Size(8, 21);
this.textBox1.TabIndex = 0;
this.textBox1.Text = "";
this.textBox1.TextChanged += new System.EventHandler(this.textBox1_TextChanged);
//
// timer1
//
this.timer1.Enabled = true;
this.timer1.Interval = 1000;
this.timer1.Tick += new System.EventHandler(this.timer1_Tick);
//
// Form_ConnactUs
//
this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
this.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("$this.BackgroundImage")));
this.ClientSize = new System.Drawing.Size(472, 382);
this.ControlBox = false;
this.Controls.Add(this.linkLabel1);
this.Controls.Add(this.label2);
this.Controls.Add(this.pictureBox1);
this.Controls.Add(this.textBox1);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
this.Name = "Form_ConnactUs";
this.StartPosition = System.Windows.Forms.FormStartPosition.Manual;
this.Text = "Form_ConnactUs";
this.Load += new System.EventHandler(this.Form_ConnactUs_Load);
this.ResumeLayout(false);
}
#endregion
public AxWMPLib.AxWindowsMediaPlayer music;
private int clicktimes=0;
private string names="sunshizhangliuhanli";
private bool correctstr=false;
private int seconds;
private void linkLabel1_LinkClicked(object sender, System.Windows.Forms.LinkLabelLinkClickedEventArgs e)
{
System.Diagnostics.Process.Start("http://srv.bjut.edu.cn");
}
private void Form_ConnactUs_Load(object sender, System.EventArgs e)
{
//System.Windows.Forms.Cursor.Hide();
music=new AxWMPLib.AxWindowsMediaPlayer();//定义media播放器
((System.ComponentModel.ISupportInitialize)(music)).BeginInit();//开始初始化media播放器
music.Visible=false;//使播放器不可见
this.Controls.Add(this.music);//向Form1添加播放器控件
((System.ComponentModel.ISupportInitialize)(music)).EndInit();//完成初始化media播放器;
}
private void textBox1_TextChanged(object sender, System.EventArgs e)
{
if(seconds<=10)
{
if(textBox1.Text==names.Substring(0,textBox1.Text.Length))
{
if(textBox1.Text==names)
{
textBox1.Text="";
correctstr=true;
}
}
else
{
textBox1.Text="";
}
}
else
{
textBox1.Text="";
}
}
private void pictureBox1_DoubleClick(object sender, System.EventArgs e)
{
if(seconds<=10)
{
if(correctstr)
{
++clicktimes;
if(clicktimes==3)
{
clicktimes=0;
correctstr=false;
MessageBox.Show("呵呵,你激活了彩蛋!");
music.URL="sound.wav";
}
}
}
else
{
correctstr=false;
}
}
private void timer1_Tick(object sender, System.EventArgs e)
{
++seconds;
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -