当前位置: 首页 > news >正文

租赁商城手机网站开发品牌营销策略分析论文

租赁商城手机网站开发,品牌营销策略分析论文,电子商务网站建设工具,网站icp备案是什么意思最近有客户问我#xff0c;怎么把Windows Media Player 嵌套在自己的项目中。 以前我在Delphi下玩过Windows Media Player#xff0c;可是在Microsoft Visual Studio 2008 没有测试过。 到网上搜索了一把#xff0c;果然得到很多例子。 其中CSDN上有个例子写的不错#xff…最近有客户问我怎么把Windows Media Player 嵌套在自己的项目中。 以前我在Delphi下玩过Windows Media Player可是在Microsoft Visual Studio 2008 没有测试过。 到网上搜索了一把果然得到很多例子。   其中CSDN上有个例子写的不错不过要扣5分【我就不去赚分了呵呵】这个是CSDN上地地址 http://download.csdn.net/source/677561 下载文件名是 EnhancedWindowsMediaPlayerusingVS2005inC#.zip   我这个例子就是用这个CSDN上提供的例子是基于Microsoft Visual Studio 2005下开发的我只是简单的把这个例子更新到Microsoft Visual Studio 2008 下不过有点小麻烦还好我已经解决了。   不多说了直接上代码   Windows Media Playerusing System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Text;using System.Windows.Forms;using System.IO;using System.Threading;using AxWMPLib;namespace MediaPlayer{        public partial class Form1 : Form    {        public static Form1 form1;        public string oldPath;        //To Load all Songs specified in Default Path        public DelegateLoadSongs m_loadSongs;        public delegate void DelegateLoadSongs();        //Thread used in loading all songs in Default Path.        public Thread execloadSongs;        public ToolStripMenuItem parentItem;        //To Add individual song as a New MenuItem        public DelegateAddSong m_AddSongs;        public delegate void DelegateAddSong(string path);        public Form1()        {            InitializeComponent();        }        private void openToolStripMenuItem_Click(object sender, EventArgs e)        {             //To Select Songs.            bool isFileExist  false;            WMPLib.IWMPPlaylistCollection playlistColl;            WMPLib.IWMPPlaylist playlist  axWindowsMediaPlayer1.newPlaylist(Test, );            if (openFileDialog1.ShowDialog() ! DialogResult.Cancel)            {                //If multiple Songs are selected,                //than it will create a New Playlist and add those songs to that list and set it as Current PlayList.                if (openFileDialog1.FileNames.Length  1)                {                    playlistColl  axWindowsMediaPlayer1.playlistCollection;                    playlist  playlistColl.newPlaylist(Test);                    if (recentFilesToolStripMenuItem.DropDownItems.Count  0)                    {                        foreach (string f in openFileDialog1.FileNames)                        {                            recentFilesToolStripMenuItem.DropDownItems.Add(f, null, recentFilesMenuItem_Click);                            RecentListcontextMenuStrip.Items.Add(f, null, recentFilesMenuItem_Click);                            WMPLib.IWMPMedia media  axWindowsMediaPlayer1.newMedia(f);                            playlist.appendItem(media);                        }                    }                    else                    {                        foreach (string f in openFileDialog1.FileNames)                        {                            isFileExist  false;                            WMPLib.IWMPMedia media  axWindowsMediaPlayer1.newMedia(f);                            playlist.appendItem(media);                            //To add to Recent Play List.                            foreach (ToolStripItem item in recentFilesToolStripMenuItem.DropDownItems)                            {                                if (item.Text  f)                                {                                    isFileExist  true;                                    break;                                }                            }                            //If selected Song is not Present in Recent Songs List previously,than it will add it.                            if (!isFileExist)                            {                                recentFilesToolStripMenuItem.DropDownItems.Add(f, null, recentFilesMenuItem_Click);                                RecentListcontextMenuStrip.Items.Add(f, null, recentFilesMenuItem_Click);                            }                        }                    }                    axWindowsMediaPlayer1.currentPlaylist  playlist;                    axWindowsMediaPlayer1.Ctlcontrols.play();                }                    //This Will add selected song to Recent PlayList and Plays it.                else if (openFileDialog1.FileNames.Length  1)                {                    axWindowsMediaPlayer1.URL  openFileDialog1.FileName;                    form1.Text  axWindowsMediaPlayer1.URL;                    if (recentFilesToolStripMenuItem.DropDownItems.Count  0)                    {                        recentFilesToolStripMenuItem.DropDownItems.Add(openFileDialog1.FileName, null, recentFilesMenuItem_Click);                        RecentListcontextMenuStrip.Items.Add(openFileDialog1.FileName, null, recentFilesMenuItem_Click);                    }                    else                    {                        foreach (ToolStripItem item in recentFilesToolStripMenuItem.DropDownItems)                        {                            if (item.Text  openFileDialog1.FileName)                            {                                isFileExist  true;                                break;                            }                        }                        if (!isFileExist)                        {                            recentFilesToolStripMenuItem.DropDownItems.Add(openFileDialog1.FileName, null, recentFilesMenuItem_Click);                            RecentListcontextMenuStrip.Items.Add(openFileDialog1.FileName, null, recentFilesMenuItem_Click);                        }                    }                }                form1.Text  axWindowsMediaPlayer1.URL;            }        }        private void recentFilesMenuItem_Click(object sender, EventArgs e)        {            try            {                //This Will just plays the selected song from Recent PlayList.                bool isFileExist  false;                if (File.Exists(((ToolStripItem)sender).Text))                {                    axWindowsMediaPlayer1.URL  ((ToolStripItem)sender).Text;                    form1.Text  ((ToolStripItem)sender).Text;                    foreach (ToolStripItem item in recentFilesToolStripMenuItem.DropDownItems)                    {                        if (item.Text  ((ToolStripItem)sender).Text)                        {                            isFileExist  true;                            break;                        }                    }                    if (!isFileExist)                    {                        recentFilesToolStripMenuItem.DropDownItems.Add(((ToolStripItem)sender).Text, null, recentFilesMenuItem_Click);                        RecentListcontextMenuStrip.Items.Add(((ToolStripItem)sender).Text, null, recentFilesMenuItem_Click);                    }                }            }            catch { }        }        private void playToolStripMenuItem_Click(object sender, EventArgs e)        {            //To Play the selected song.            axWindowsMediaPlayer1.Ctlcontrols.play();        }        private void pauseToolStripMenuItem_Click(object sender, EventArgs e)        {            //To pause the selected song.            axWindowsMediaPlayer1.Ctlcontrols.pause();        }        private void stopToolStripMenuItem_Click(object sender, EventArgs e)        {            //To Stop the selected song.            axWindowsMediaPlayer1.Ctlcontrols.stop();        }        private void exitToolStripMenuItem_Click(object sender, EventArgs e)        {            //To Exit Application.            Application.Exit();        }        private void topMostToolStripMenuItem_Click(object sender, EventArgs e)        {            //To Show Media Player on top of other Windows.            if (topMostToolStripMenuItem.Checked)            {                topMostToolStripMenuItem.Checked  false;                form1.TopMost  false;                form1.ShowInTaskbar  true;            }            else            {                topMostToolStripMenuItem.Checked  true;                form1.TopMost  true;                form1.ShowInTaskbar  false;            }        }        private void opacityToolStripMenuItem_Click(object sender, EventArgs e)        {            //To Set Opacity of the Form.            if (opacityToolStripMenuItem.Checked)            {                opacityToolStripMenuItem.Checked  false;                form1.Opacity  1;            }            else            {                opacityToolStripMenuItem.Checked  true;                form1.Opacity  0;            }        }                private void showInTaToolStripMenuItem_Click(object sender, EventArgs e)        {            //To Set whether to display Form in TaskBar or not.            if (showInTaToolStripMenuItem.Checked)            {                showInTaToolStripMenuItem.Checked  false;                form1.ShowInTaskbar  false;            }            else            {                showInTaToolStripMenuItem.Checked  true;                form1.ShowInTaskbar  true;            }        }        private void axWindowsMediaPlayer1_MediaError(object sender, AxWMPLib._WMPOCXEvents_MediaErrorEvent e)        {            //Generic Error Message.            MessageBox.Show(Error occured);        }        private void showBorderToolStripMenuItem_Click(object sender, EventArgs e)        {            //To Set whether Form Border should be displayed or not.            if (showBorderToolStripMenuItem.Checked)            {                showBorderToolStripMenuItem.Checked  false;                form1.FormBorderStyle  FormBorderStyle.None;            }            else            {                showBorderToolStripMenuItem.Checked  true;                form1.FormBorderStyle  FormBorderStyle.Sizable;            }                    }        private void notifyIcon1_DoubleClick(object sender, EventArgs e)        {            //To Set Visibility of the Form.            try            {                if (form1.Visible)                {                    form1.Visible  false;                    form1.Opacity  1;                }                else                {                    form1.Visible  true;                }            }            catch            { }        }        private void timer1_Tick(object sender, EventArgs e)        {            //To Change NotifyIcon Image.            try            {                Random r  new Random();                notifyIcon1.Icon  new Icon(..\\..\\Images\\  r.Next(1,11)  .ico);            }            catch { }        }        private void menuStrip1_MouseHover(object sender, EventArgs e)        {            //T Show Form Border.            form1.FormBorderStyle  FormBorderStyle.Sizable;        }        private void Form1_Load(object sender, EventArgs e)        {            //To Load Recent PlayList Items,Default songs Path from the File.            if (File.Exists(c:\Media PlayList\List.txt))            {                StreamReader reader  new StreamReader(c:\Media PlayList\List.txt);                string fname  ;                while ((fname  reader.ReadLine()) ! null)                {                    if (!fname.StartsWith(----))                    {                        recentFilesToolStripMenuItem.DropDownItems.Add(fname, null, recentFilesMenuItem_Click);                        RecentListcontextMenuStrip.Items.Add(fname, null, recentFilesMenuItem_Click);                    }                    else                    {                        //Default Songs Path.                        DefaultPathtoolStripTextBox.Text  fname.TrimStart(-);                        //To Load all songs present in Default Songs Path.                        DefaultPathtoolStripTextBox_KeyDown(sender, null);                    }                }                reader.Close();            }                    }        private void Form1_FormClosed(object sender, FormClosedEventArgs e)        {            //To Save Recent PlayList Items,Default Songs Path to the file.            if (!Directory.Exists(c:\Media PlayList))            {                Directory.CreateDirectory(c:\Media PlayList);            }            File.Delete(c:\Media PlayList\List.txt);            File.Create(c:\Media PlayList\List.txt).Close();            System.IO.StreamWriter writer  new StreamWriter(c:\Media PlayList\List.txt);            foreach (ToolStripMenuItem fItem in recentFilesToolStripMenuItem.DropDownItems)            {                writer.WriteLine(fItem.Text);            }            writer.WriteLine(----  DefaultPathtoolStripTextBox.Text.Trim());            writer.Close();            //To Kill the thread used to load Default Path Songs.            if (execloadSongs ! null)            {                if (execloadSongs.IsAlive)                {                    execloadSongs.Abort();                    execloadSongs  null;                }            }        }        private void optionsToolStripMenuItem_Click(object sender, EventArgs e)        {            //To Show Form Border.            form1.FormBorderStyle  FormBorderStyle.Sizable;        }        private void DeleteFListToolStripMenuItem_Click(object sender, EventArgs e)        {            //To Delete Recent Songs List.            recentFilesToolStripMenuItem.DropDownItems.Clear();            File.Delete(c:\Media PlayList\List.txt);        }        private void axWindowsMediaPlayer1_MouseUpEvent(object sender, _WMPOCXEvents_MouseUpEvent e)        {            //To Set Visibility of Forms Border,MenuStrip.            if (menuStrip1.Visible)            {                if (!showBorderToolStripMenuItem.Checked)                {                    menuStrip1.Visible  false;                    form1.FormBorderStyle  FormBorderStyle.None;                    axWindowsMediaPlayer1.uiMode  None;                    axWindowsMediaPlayer1.windowlessVideo  true;                }            }            else            {                if (!showBorderToolStripMenuItem.Checked)                {                    menuStrip1.Visible  true;                    form1.FormBorderStyle  FormBorderStyle.Sizable;                    axWindowsMediaPlayer1.uiMode  full;                    axWindowsMediaPlayer1.windowlessVideo  false;                }            }        }        private void LoadAllSongs()        {            try            {                //To Load all songs present in Default Songs Path.                string paths  DefaultPathtoolStripTextBox.Text.Trim();                string[] allpaths  paths.Split(;);                foreach (string path in allpaths)                {                    m_AddSongs  new DelegateAddSong(this.AddSong);                    if (Directory.Exists(path))                    {                        DirectoryInfo dirinfo1  new DirectoryInfo(Path.GetDirectoryName(path));                        Image img  Image.FromFile(..\\..\\Images\\folder.gif);                        parentItem  SongsListtoolStripMenuItem;                        form1.getDirs(dirinfo1);                        if (recursivelyToolStripMenuItem.Checked)                        {                            LoadAllSongs(SongsListtoolStripMenuItem);                        }                    }                }            }            catch { }        }        public void getDirs(DirectoryInfo d)        {            //To Load All Directories.            DirectoryInfo[] dirs  d.GetDirectories(*.*);            getFiles(d);            foreach (DirectoryInfo dir in dirs)            {                this.Invoke(m_AddSongs, new object[] { dir.FullName });            }        }        public void getFiles(DirectoryInfo d)        {            //To Load All Files in a Directory.            FileInfo[] files;            files  d.GetFiles(*.*);            foreach (FileInfo file in files)            {                String fileName  file.FullName;                this.Invoke(m_AddSongs, new object[] { file.FullName  ?? });            }        }        private void LoadAllSongs(ToolStripMenuItem item)        {            //Recursion used to load all directorys contents.            foreach (ToolStripMenuItem item1 in item.DropDownItems)            {                if (oldPath ! item1.Text)                {                    if (item1.Image ! null)                    {                        parentItem  item1;                        oldPath  item1.Text;                        form1.getDirs(new DirectoryInfo(item1.Text));                        LoadAllSongs(item1);                    }                }            }        }        private void AddSong(string path)        {            try            {                //To add a song to the Default songs LIst                if (path.EndsWith(??))                {                    //To Add Files without any Image in it.                    parentItem.DropDownItems.Add(path.TrimEnd(?), null, recentFilesMenuItem_Click);                }                else                {                    ToolStripMenuItem item  new ToolStripMenuItem();                    Image img  Image.FromFile(..\\..\\Images\\folder.gif);                    item.Text  path.TrimEnd(?);                    item.Image  img;                    parentItem.DropDownItems.Add(item);                }            }            catch { }        }        private void DefaultPathtoolStripTextBox_KeyDown(object sender, KeyEventArgs e)        {            //To Load all Songs,Once Default Songs Path is Changed.            if (e  null)            {                SongsListtoolStripMenuItem.DropDownItems.Clear();                m_loadSongs  new DelegateLoadSongs(this.LoadAllSongs);                ThreadStart ts  new ThreadStart(this.m_loadSongs);                execloadSongs  new Thread(ts);                execloadSongs.Start();                return;            }            if (e.KeyCode  Keys.Enter)            {                SongsListtoolStripMenuItem.DropDownItems.Clear();                m_loadSongs  new DelegateLoadSongs(this.LoadAllSongs);                ThreadStart ts  new ThreadStart(this.m_loadSongs);                execloadSongs  new Thread(ts);                execloadSongs.Start();            }        }        private void recursivelyToolStripMenuItem_Click(object sender, EventArgs e)        {            //To Set whether songs should be loaded recursively in Folders or not.            if (recursivelyToolStripMenuItem.Checked)            {                recursivelyToolStripMenuItem.Checked  false;            }            else            {                recursivelyToolStripMenuItem.Checked  true;            }        }        private void notifyIcon1_MouseClick(object sender, MouseEventArgs e)        {            if (e.Button  MouseButtons.Middle)            {                //To change the Player status on Click on NotifyIcon using Middle Mouses Button.                if (axWindowsMediaPlayer1.status ! )                {                    if (axWindowsMediaPlayer1.status.ToLower().StartsWith(playing))                    {                        axWindowsMediaPlayer1.Ctlcontrols.pause();                    }                    else if (axWindowsMediaPlayer1.status.ToLower().StartsWith(paused))                    {                        axWindowsMediaPlayer1.Ctlcontrols.play();                    }                }            }        }    }} 下面是整个工程  http://files.cnblogs.com/OceanChen/WindowsMediaPlayer.rar 注意在运行工程之前需要先添加AxInterop.WMPLib.dllInterop.MediaPlayer.dllInterop.WMPLib.dll引用转载于:https://www.cnblogs.com/OceanChen/archive/2009/03/06/1404685.html
http://www.pierceye.com/news/741660/

相关文章:

  • 网站备案 深圳wap免费空间
  • 如何建设网站安全外贸公司名称
  • 网站前后台jsp网站模版
  • 网站内页标题怎么填网站设计方案大全
  • 网站优化毕业设计威海网站建设 孔
  • 网站建设方案书制作流程北京做网站推广seo
  • 钦州网站建设设计南宁企业网站建设技术公司
  • 公路建设查询网站蛋花儿wordpress主题
  • 网站图片加alt标签青岛seo做的好的网站
  • centos 7.2 做网站做.net网站流程
  • 做网站都有哪些费用app网站的优点
  • 茂名营销网站开发浙江华洋建设有限公司网站
  • 服装网站建设都有哪些注册公司流程视频
  • 泉州网站建设的步骤wordpress 接收json
  • 西宁网站设计全屏网站模版
  • 网站建设代理平台中国建设银行网站首页 定投
  • 备案 网站内容电商网站充值消费系统
  • 上海闸北区网站建设广州市网站建设制作
  • 阜阳公司做网站余江区建设局网站
  • 南山网站设计方案网站开发的客户群体
  • 汕头市建设网站高端网站定制的案例
  • 深圳外贸网站设计公司郑州seo培训
  • 公司高端网站设计公司湖南竞网做网站好吗
  • 做微信的微网站费用黄冈论坛遗爱湖
  • 设计师用什么做网站河南程序开发公司
  • 路由器做服务器做网站怎么在百度发布免费广告
  • 惠州网站制作推广做响应式网站设计做图怎么搞
  • 天津高端网站设计公司美食网页设计图
  • 做柱状图饼状图好看的网站四川省住房和城乡建设厅证书
  • 网站建设公司模版wordpress自适应站点