📄 frmmediaplayer.cs.cs
字号:
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.IO;
using System.Xml;
using System.Runtime.InteropServices;
using System.Diagnostics;
using System.Reflection;
namespace MediaPlayer
{
/// <summary>
/// frmMediaPlayer 的摘要说明。
/// </summary>
public class frmMediaPlayer : System.Windows.Forms.Form
{
private System.Windows.Forms.MainMenu menuMain;
private System.Windows.Forms.MenuItem menuItem1;
private System.Windows.Forms.MenuItem menuItem2;
private AxWMPLib.AxWindowsMediaPlayer WMMusic;
private System.Windows.Forms.ListBox lstMusic;
private System.Windows.Forms.ListBox lstMusicName;
private System.Windows.Forms.Timer timMusic;
private System.Windows.Forms.NotifyIcon ntfMusic;
private System.Windows.Forms.MenuItem menuItem3;
private System.Windows.Forms.MenuItem menuItem4;
private System.Windows.Forms.MenuItem menuItem5;
private System.Windows.Forms.MenuItem menuItem6;
private System.Windows.Forms.MenuItem menuItem7;
private System.Windows.Forms.MenuItem menuItem8;
private System.Windows.Forms.MenuItem menuItem9;
private System.Windows.Forms.MenuItem menuItem10;
private System.Windows.Forms.ContextMenu contextMenu1;
private System.Windows.Forms.MenuItem menuItem11;
private System.Windows.Forms.MenuItem menuItem12;
private System.Windows.Forms.MenuItem menuItem13;
private System.Windows.Forms.MenuItem menuItem14;
private System.Windows.Forms.ContextMenu contextMenu2;
private System.Windows.Forms.ContextMenu contextMenu3;
private System.Windows.Forms.MenuItem menuItem15;
private System.Windows.Forms.MenuItem menuItem16;
private System.Windows.Forms.MenuItem menuItem17;
private System.Windows.Forms.MenuItem menuItem18;
private System.Windows.Forms.MenuItem menuItem19;
private System.Windows.Forms.MenuItem menuItem20;
private System.Windows.Forms.MenuItem menuItem21;
private System.Windows.Forms.MenuItem menuItem22;
private System.Windows.Forms.MenuItem menuItem23;
private System.Windows.Forms.MenuItem menuItem24;
private System.Windows.Forms.MenuItem menuItem26;
private System.Windows.Forms.MenuItem menuItem27;
private System.Windows.Forms.MenuItem menuItem28;
private System.Windows.Forms.MenuItem menuItem29;
private System.Windows.Forms.MenuItem menuItem30;
private System.Windows.Forms.MenuItem menuItem31;
private System.Windows.Forms.MenuItem menuItem32;
private System.Windows.Forms.MenuItem menuItem33;
private System.Windows.Forms.MenuItem menuItem34;
private System.Windows.Forms.MenuItem menuItem35;
private System.Windows.Forms.TextBox txtRename;
public System.Windows.Forms.ToolTip toolTxtRename;
private System.ComponentModel.IContainer components;
public frmMediaPlayer()
{
//
// 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(frmMediaPlayer));
this.WMMusic = new AxWMPLib.AxWindowsMediaPlayer();
this.menuMain = new System.Windows.Forms.MainMenu();
this.menuItem1 = new System.Windows.Forms.MenuItem();
this.menuItem2 = new System.Windows.Forms.MenuItem();
this.menuItem6 = new System.Windows.Forms.MenuItem();
this.menuItem3 = new System.Windows.Forms.MenuItem();
this.menuItem4 = new System.Windows.Forms.MenuItem();
this.menuItem5 = new System.Windows.Forms.MenuItem();
this.menuItem7 = new System.Windows.Forms.MenuItem();
this.menuItem8 = new System.Windows.Forms.MenuItem();
this.menuItem9 = new System.Windows.Forms.MenuItem();
this.menuItem10 = new System.Windows.Forms.MenuItem();
this.lstMusic = new System.Windows.Forms.ListBox();
this.contextMenu2 = new System.Windows.Forms.ContextMenu();
this.menuItem27 = new System.Windows.Forms.MenuItem();
this.menuItem29 = new System.Windows.Forms.MenuItem();
this.menuItem15 = new System.Windows.Forms.MenuItem();
this.menuItem24 = new System.Windows.Forms.MenuItem();
this.menuItem16 = new System.Windows.Forms.MenuItem();
this.menuItem30 = new System.Windows.Forms.MenuItem();
this.menuItem26 = new System.Windows.Forms.MenuItem();
this.menuItem31 = new System.Windows.Forms.MenuItem();
this.menuItem17 = new System.Windows.Forms.MenuItem();
this.menuItem32 = new System.Windows.Forms.MenuItem();
this.menuItem28 = new System.Windows.Forms.MenuItem();
this.lstMusicName = new System.Windows.Forms.ListBox();
this.contextMenu3 = new System.Windows.Forms.ContextMenu();
this.menuItem18 = new System.Windows.Forms.MenuItem();
this.menuItem33 = new System.Windows.Forms.MenuItem();
this.menuItem19 = new System.Windows.Forms.MenuItem();
this.menuItem34 = new System.Windows.Forms.MenuItem();
this.menuItem20 = new System.Windows.Forms.MenuItem();
this.menuItem35 = new System.Windows.Forms.MenuItem();
this.menuItem21 = new System.Windows.Forms.MenuItem();
this.menuItem22 = new System.Windows.Forms.MenuItem();
this.menuItem23 = new System.Windows.Forms.MenuItem();
this.timMusic = new System.Windows.Forms.Timer(this.components);
this.ntfMusic = new System.Windows.Forms.NotifyIcon(this.components);
this.contextMenu1 = new System.Windows.Forms.ContextMenu();
this.menuItem11 = new System.Windows.Forms.MenuItem();
this.menuItem12 = new System.Windows.Forms.MenuItem();
this.menuItem14 = new System.Windows.Forms.MenuItem();
this.menuItem13 = new System.Windows.Forms.MenuItem();
this.txtRename = new System.Windows.Forms.TextBox();
this.toolTxtRename = new System.Windows.Forms.ToolTip(this.components);
((System.ComponentModel.ISupportInitialize)(this.WMMusic)).BeginInit();
this.SuspendLayout();
//
// WMMusic
//
this.WMMusic.Enabled = true;
this.WMMusic.Location = new System.Drawing.Point(0, 0);
this.WMMusic.Name = "WMMusic";
this.WMMusic.OcxState = ((System.Windows.Forms.AxHost.State)(resources.GetObject("WMMusic.OcxState")));
this.WMMusic.Size = new System.Drawing.Size(464, 208);
this.WMMusic.TabIndex = 0;
//
// menuMain
//
this.menuMain.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
this.menuItem1,
this.menuItem9});
//
// menuItem1
//
this.menuItem1.Index = 0;
this.menuItem1.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
this.menuItem2,
this.menuItem6,
this.menuItem3,
this.menuItem4,
this.menuItem5,
this.menuItem7,
this.menuItem8});
this.menuItem1.Text = "文件(&F)";
//
// menuItem2
//
this.menuItem2.Index = 0;
this.menuItem2.Text = "打开(&O)";
this.menuItem2.Click += new System.EventHandler(this.menuItem2_Click);
//
// menuItem6
//
this.menuItem6.Index = 1;
this.menuItem6.Text = "-";
//
// menuItem3
//
this.menuItem3.Index = 2;
this.menuItem3.Text = "新建列表(&A)";
this.menuItem3.Click += new System.EventHandler(this.menuItem3_Click);
//
// menuItem4
//
this.menuItem4.Index = 3;
this.menuItem4.Text = "删除列表(&D)";
this.menuItem4.Click += new System.EventHandler(this.menuItem4_Click);
//
// menuItem5
//
this.menuItem5.Index = 4;
this.menuItem5.Text = "重命名(&R)";
this.menuItem5.Click += new System.EventHandler(this.menuItem5_Click);
//
// menuItem7
//
this.menuItem7.Index = 5;
this.menuItem7.Text = "-";
//
// menuItem8
//
this.menuItem8.Index = 6;
this.menuItem8.Text = "退出(&E)";
this.menuItem8.Click += new System.EventHandler(this.menuItem8_Click);
//
// menuItem9
//
this.menuItem9.Index = 1;
this.menuItem9.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
this.menuItem10});
this.menuItem9.Text = "帮助(&H)";
//
// menuItem10
//
this.menuItem10.Index = 0;
this.menuItem10.Text = "关于千千静听(&A)...";
this.menuItem10.Click += new System.EventHandler(this.menuItem10_Click);
//
// lstMusic
//
this.lstMusic.BackColor = System.Drawing.SystemColors.WindowFrame;
this.lstMusic.ContextMenu = this.contextMenu2;
this.lstMusic.ForeColor = System.Drawing.Color.DodgerBlue;
this.lstMusic.ItemHeight = 12;
this.lstMusic.Location = new System.Drawing.Point(0, 208);
this.lstMusic.Name = "lstMusic";
this.lstMusic.Size = new System.Drawing.Size(120, 256);
this.lstMusic.TabIndex = 2;
this.lstMusic.DoubleClick += new System.EventHandler(this.lstMusic_DoubleClick);
this.lstMusic.SelectedIndexChanged += new System.EventHandler(this.lstMusic_SelectedIndexChanged);
//
// contextMenu2
//
this.contextMenu2.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
this.menuItem27,
this.menuItem29,
this.menuItem15,
this.menuItem24,
this.menuItem16,
this.menuItem30,
this.menuItem26,
this.menuItem31,
this.menuItem17,
this.menuItem32,
this.menuItem28});
//
// menuItem27
//
this.menuItem27.DefaultItem = true;
this.menuItem27.Enabled = false;
this.menuItem27.Index = 0;
this.menuItem27.Text = "切换列表(&W)";
//
// menuItem29
//
this.menuItem29.Index = 1;
this.menuItem29.Text = "-";
//
// menuItem15
//
this.menuItem15.DefaultItem = true;
this.menuItem15.Index = 2;
this.menuItem15.Text = "新建列表(N)";
this.menuItem15.Click += new System.EventHandler(this.menuItem15_Click);
//
// menuItem24
//
this.menuItem24.Index = 3;
this.menuItem24.Text = "添加歌曲(&A)";
this.menuItem24.Click += new System.EventHandler(this.menuItem24_Click);
//
// menuItem16
//
this.menuItem16.Index = 4;
this.menuItem16.Text = "删除列表(&D)";
this.menuItem16.Click += new System.EventHandler(this.menuItem16_Click);
//
// menuItem30
//
this.menuItem30.Index = 5;
this.menuItem30.Text = "-";
//
// menuItem26
//
this.menuItem26.Index = 6;
this.menuItem26.Text = "保存所有列表...";
this.menuItem26.Click += new System.EventHandler(this.menuItem26_Click);
//
// menuItem31
//
this.menuItem31.Index = 7;
this.menuItem31.Text = "-";
//
// menuItem17
//
this.menuItem17.Index = 8;
this.menuItem17.Text = "重命名(&R)";
this.menuItem17.Click += new System.EventHandler(this.menuItem17_Click);
//
// menuItem32
//
this.menuItem32.Index = 9;
this.menuItem32.Text = "-";
//
// menuItem28
//
this.menuItem28.Index = 10;
this.menuItem28.Text = "按名称排序...";
this.menuItem28.Click += new System.EventHandler(this.menuItem28_Click);
//
// lstMusicName
//
this.lstMusicName.BackColor = System.Drawing.SystemColors.WindowFrame;
this.lstMusicName.ContextMenu = this.contextMenu3;
this.lstMusicName.ForeColor = System.Drawing.Color.DodgerBlue;
this.lstMusicName.ItemHeight = 12;
this.lstMusicName.Location = new System.Drawing.Point(120, 208);
this.lstMusicName.Name = "lstMusicName";
this.lstMusicName.SelectionMode = System.Windows.Forms.SelectionMode.MultiExtended;
this.lstMusicName.Size = new System.Drawing.Size(344, 256);
this.lstMusicName.TabIndex = 3;
this.lstMusicName.DoubleClick += new System.EventHandler(this.lstMusicName_DoubleClick);
//
// contextMenu3
//
this.contextMenu3.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
this.menuItem18,
this.menuItem33,
this.menuItem19,
this.menuItem34,
this.menuItem20,
this.menuItem35,
this.menuItem21,
this.menuItem22,
this.menuItem23});
//
// menuItem18
//
this.menuItem18.DefaultItem = true;
this.menuItem18.Index = 0;
this.menuItem18.Text = "播放(&P)";
this.menuItem18.Click += new System.EventHandler(this.menuItem18_Click);
//
// menuItem33
//
this.menuItem33.Index = 1;
this.menuItem33.Text = "-";
//
// menuItem19
//
this.menuItem19.Index = 2;
this.menuItem19.Text = "删除(&D)";
this.menuItem19.Click += new System.EventHandler(this.menuItem19_Click);
//
// menuItem34
//
this.menuItem34.Index = 3;
this.menuItem34.Text = "-";
//
// menuItem20
//
this.menuItem20.Index = 4;
this.menuItem20.Text = "文件信息(I)";
//
// menuItem35
//
this.menuItem35.Index = 5;
this.menuItem35.Text = "-";
//
// menuItem21
//
this.menuItem21.Index = 6;
this.menuItem21.Text = "剪切(&T)";
//
// menuItem22
//
this.menuItem22.Index = 7;
this.menuItem22.Text = "复制(C)";
//
// menuItem23
//
this.menuItem23.Index = 8;
this.menuItem23.Text = "粘贴(&P)";
//
// timMusic
//
this.timMusic.Tick += new System.EventHandler(this.timMusic_Tick);
//
// ntfMusic
//
this.ntfMusic.ContextMenu = this.contextMenu1;
this.ntfMusic.Icon = ((System.Drawing.Icon)(resources.GetObject("ntfMusic.Icon")));
this.ntfMusic.Text = "AuthorQQ:26074159";
this.ntfMusic.Visible = true;
this.ntfMusic.DoubleClick += new System.EventHandler(this.ntfMusic_DoubleClick);
//
// contextMenu1
//
this.contextMenu1.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -