using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace WindowsApplication1
{
    public partial class Form014 : Form
    {
        public Form014()
        {
            InitializeComponent();
        }

        // 当点击打开文件时候触发该事件
        private void filecontrol_Click(object sender, EventArgs e)
        {
            this.Text = "我的播放器";//确定窗体左上角文本信息
            OpenFileDialog open = new OpenFileDialog();//创建一个打开的对话框
            open.AddExtension = true;//设置是否自动在文件中添加扩展名
            open.CheckFileExists = true;//检查文件是否存在
            open.Filter = "多媒体文件(*.AVI)|*.avi|多媒体文件(*.wmv)|*.wmv|所有文件(*.*)|*.*";//设置将打开文件的类型
            if (open.ShowDialog() == DialogResult.OK)
            {
                this.axWindowsMediaPlayer1.URL = open.FileName;//开始播放
                this.Text += "----当前播放：" + this.axWindowsMediaPlayer1.URL.ToString();
            }
        }
    }
}