本文介绍了如何为axWindowsMediaPlayer1.URL设置静态路径?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

各位大家好!



所以我正在制作一款内置音乐播放器的应用。我在 []。但是当我单击一个按钮而不使用openfiledialog时,我需要从/admin/admin/bin/debug/sounds/music.mp3播放mp3 / wav文件。 P.S admin是项目的目录。



Hello everybody!

So I'm making an app which has a music player in it. I 've found this code on http://www.c-sharpcorner.com/uploadfile/e628d9/playing-audio-and-video-files-using-c-sharp/[^]. But I need to play a mp3/ wav file from /admin/admin/bin/debug/sounds/music.mp3 when I click a button without using openfiledialog. P.S admin is the project's directory.

using System;
using System.Windows.Forms;

namespace mymediaplayer
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }
        private void btnBrowse_Click(object sender, EventArgs e)
        {
            openFileDialog1.Filter = "(mp3,wav,mp4,mov,wmv,mpg)|*.mp3;*.wav;*.mp4;*.mov;*.wmv;*.mpg|all files|*.*";
            if(openFileDialog1.ShowDialog()==DialogResult.OK)
                axWindowsMediaPlayer1.URL = openFileDialog1.FileName;
        }
    }
}





如何设置静态路径(/ admin / admin /bin/debug/sounds/music.mp3)for axWindowsMediaPlayer1.URL?



提前感谢您的帮助!祝你有愉快的一天!



How do I set a static path (/admin/admin/bin/debug/sounds/music.mp3) for axWindowsMediaPlayer1.URL?

Thank you in advance for your help! Have a nice day!

推荐答案

这篇关于如何为axWindowsMediaPlayer1.URL设置静态路径?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-30 04:56