Form_ConnactUs.cs
上传用户:chinapurv
上传日期:2014-03-12
资源大小:4870k
文件大小:6k
源码类别:

教育系统应用

开发平台:

C#

  1. using System;
  2. using System.Drawing;
  3. using System.Collections;
  4. using System.ComponentModel;
  5. using System.Windows.Forms;
  6. namespace 图书管理系统
  7. {
  8. /// <summary>
  9. /// Form_ConnactUs 的摘要说明。
  10. /// </summary>
  11. public class Form_ConnactUs : System.Windows.Forms.Form
  12. {
  13. private System.Windows.Forms.Label label2;
  14. private System.Windows.Forms.PictureBox pictureBox1;
  15. private System.Windows.Forms.LinkLabel linkLabel1;
  16. private System.Windows.Forms.TextBox textBox1;
  17. private System.Windows.Forms.Timer timer1;
  18. private System.ComponentModel.IContainer components;
  19. public Form_ConnactUs()
  20. {
  21. //
  22. // Windows 窗体设计器支持所必需的
  23. //
  24. InitializeComponent();
  25. //
  26. // TODO: 在 InitializeComponent 调用后添加任何构造函数代码
  27. //
  28. }
  29. /// <summary>
  30. /// 清理所有正在使用的资源。
  31. /// </summary>
  32. protected override void Dispose( bool disposing )
  33. {
  34. if( disposing )
  35. {
  36. if(components != null)
  37. {
  38. components.Dispose();
  39. }
  40. }
  41. base.Dispose( disposing );
  42. }
  43. #region Windows 窗体设计器生成的代码
  44. /// <summary>
  45. /// 设计器支持所需的方法 - 不要使用代码编辑器修改
  46. /// 此方法的内容。
  47. /// </summary>
  48. private void InitializeComponent()
  49. {
  50. this.components = new System.ComponentModel.Container();
  51. System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(Form_ConnactUs));
  52. this.label2 = new System.Windows.Forms.Label();
  53. this.pictureBox1 = new System.Windows.Forms.PictureBox();
  54. this.linkLabel1 = new System.Windows.Forms.LinkLabel();
  55. this.textBox1 = new System.Windows.Forms.TextBox();
  56. this.timer1 = new System.Windows.Forms.Timer(this.components);
  57. this.SuspendLayout();
  58. // 
  59. // label2
  60. // 
  61. this.label2.BackColor = System.Drawing.Color.Transparent;
  62. this.label2.Font = new System.Drawing.Font("隶书", 26.25F, System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
  63. this.label2.Location = new System.Drawing.Point(16, 280);
  64. this.label2.Name = "label2";
  65. this.label2.Size = new System.Drawing.Size(440, 56);
  66. this.label2.TabIndex = 3;
  67. this.label2.Text = "诚  信  至  上";
  68. this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
  69. // 
  70. // pictureBox1
  71. // 
  72. this.pictureBox1.Image = ((System.Drawing.Image)(resources.GetObject("pictureBox1.Image")));
  73. this.pictureBox1.Location = new System.Drawing.Point(20, 24);
  74. this.pictureBox1.Name = "pictureBox1";
  75. this.pictureBox1.Size = new System.Drawing.Size(432, 248);
  76. this.pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;
  77. this.pictureBox1.TabIndex = 2;
  78. this.pictureBox1.TabStop = false;
  79. this.pictureBox1.DoubleClick += new System.EventHandler(this.pictureBox1_DoubleClick);
  80. // 
  81. // linkLabel1
  82. // 
  83. this.linkLabel1.BackColor = System.Drawing.Color.Transparent;
  84. this.linkLabel1.LinkColor = System.Drawing.Color.Red;
  85. this.linkLabel1.Location = new System.Drawing.Point(360, 352);
  86. this.linkLabel1.Name = "linkLabel1";
  87. this.linkLabel1.Size = new System.Drawing.Size(104, 16);
  88. this.linkLabel1.TabIndex = 4;
  89. this.linkLabel1.TabStop = true;
  90. this.linkLabel1.Text = "连接到我们的主页";
  91. this.linkLabel1.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.linkLabel1_LinkClicked);
  92. // 
  93. // textBox1
  94. // 
  95. this.textBox1.Location = new System.Drawing.Point(24, 248);
  96. this.textBox1.Name = "textBox1";
  97. this.textBox1.Size = new System.Drawing.Size(8, 21);
  98. this.textBox1.TabIndex = 0;
  99. this.textBox1.Text = "";
  100. this.textBox1.TextChanged += new System.EventHandler(this.textBox1_TextChanged);
  101. // 
  102. // timer1
  103. // 
  104. this.timer1.Enabled = true;
  105. this.timer1.Interval = 1000;
  106. this.timer1.Tick += new System.EventHandler(this.timer1_Tick);
  107. // 
  108. // Form_ConnactUs
  109. // 
  110. this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
  111. this.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("$this.BackgroundImage")));
  112. this.ClientSize = new System.Drawing.Size(472, 382);
  113. this.ControlBox = false;
  114. this.Controls.Add(this.linkLabel1);
  115. this.Controls.Add(this.label2);
  116. this.Controls.Add(this.pictureBox1);
  117. this.Controls.Add(this.textBox1);
  118. this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
  119. this.Name = "Form_ConnactUs";
  120. this.StartPosition = System.Windows.Forms.FormStartPosition.Manual;
  121. this.Text = "Form_ConnactUs";
  122. this.Load += new System.EventHandler(this.Form_ConnactUs_Load);
  123. this.ResumeLayout(false);
  124. }
  125. #endregion
  126. public AxWMPLib.AxWindowsMediaPlayer music;
  127. private int clicktimes=0;
  128. private string names="sunshizhangliuhanli";
  129. private bool correctstr=false;
  130. private int seconds;
  131. private void linkLabel1_LinkClicked(object sender, System.Windows.Forms.LinkLabelLinkClickedEventArgs e)
  132. {
  133. System.Diagnostics.Process.Start("http://srv.bjut.edu.cn");
  134. }
  135. private void Form_ConnactUs_Load(object sender, System.EventArgs e)
  136. {
  137. //System.Windows.Forms.Cursor.Hide();
  138. music=new AxWMPLib.AxWindowsMediaPlayer();//定义media播放器
  139. ((System.ComponentModel.ISupportInitialize)(music)).BeginInit();//开始初始化media播放器
  140. music.Visible=false;//使播放器不可见
  141. this.Controls.Add(this.music);//向Form1添加播放器控件
  142. ((System.ComponentModel.ISupportInitialize)(music)).EndInit();//完成初始化media播放器;
  143. }
  144. private void textBox1_TextChanged(object sender, System.EventArgs e)
  145. {
  146. if(seconds<=10)
  147. {
  148. if(textBox1.Text==names.Substring(0,textBox1.Text.Length))
  149. {
  150. if(textBox1.Text==names)
  151. {
  152. textBox1.Text="";
  153. correctstr=true;
  154. }
  155. }
  156. else
  157. {
  158. textBox1.Text="";
  159. }
  160. }
  161. else
  162. {
  163. textBox1.Text="";
  164. }
  165. }
  166. private void pictureBox1_DoubleClick(object sender, System.EventArgs e)
  167. {
  168. if(seconds<=10)
  169. {
  170. if(correctstr)
  171. {
  172. ++clicktimes;
  173. if(clicktimes==3)
  174. {
  175. clicktimes=0;
  176. correctstr=false;
  177. MessageBox.Show("呵呵,你激活了彩蛋!");
  178. music.URL="sound.wav";
  179. }
  180. }
  181. }
  182. else
  183. {
  184. correctstr=false;
  185. }
  186. }
  187. private void timer1_Tick(object sender, System.EventArgs e)
  188. {
  189. ++seconds;
  190. }
  191. }
  192. }