C# Media Player 控件问题处理共几种方法:
1.用控件的方法,先在工具箱com组件里面添加,然后拖放进去,然后调用
axWindowsMediaPlayer1.URL = "D:\\ordersuccess.wav";
axWindowsMediaPlayer1.Ctlcontrols.play();
可以播放了
2.如果不想看到控件就用
axWindowsMediaPlayer3.Visible = false;
隐藏也可以
3.不用拖放控件,新建一个tempForm,让控件附加到上面,就可以了,还需要初始化下,比较麻烦
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using AxWMPLib;
namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
static int testnumber = 0;
AxWindowsMediaPlayer axWindowsMediaPlayer1 = new AxWindowsMediaPlayer();
AxWindowsMediaPlayer axWindowsMediaPlayer2 = new A