跪求一个用vb 编程实现windows mediaplayer 顺序播放 和歌词同步显示的 源代码

2025-02-28 13:40:47
推荐回答(2个)
回答1:

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

namespace WindowsApplication16
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
this.axWindowsMediaPlayer1.URL = Application.StartupPath +@"\等一分钟.mp3";

}

private void 打开OToolStripMenuItem_Click(object sender, EventArgs e)
{
OpenFileDialog open = new OpenFileDialog();
open.AddExtension = true;
open.CheckFileExists = true;
open.Filter = "MP3文件(*.mp3)|*.mp3|所有文件(*.*)|*.*";
if (open.ShowDialog() == DialogResult.OK)
{
this.axWindowsMediaPlayer1.URL= open.FileName;
}
// string AppPath = Application.StartupPath;
//string RptFileFullName = AppPath + @"\(你的flash文件)";
//获取应用程序的当前工作目录。

string path = Application.ExecutablePath + @"..\images\1.gif";
MessageBox.Show(path);

String path1 = System.IO.Directory.GetCurrentDirectory();
MessageBox.Show("获取应用程序的当前工作目录:" + path1);

//获取程序的基目录。
String path2 = System.AppDomain.CurrentDomain.BaseDirectory;
MessageBox.Show("获取程序的基目录:" + path2);

//获取和设置包括该应用程序的目录的名称。
String path3 = System.AppDomain.CurrentDomain.SetupInformation.ApplicationBase;
MessageBox.Show("获取和设置包括该应用程序的目录的名称:" + path3);

//获取启动了应用程序的可执行文件的路径,不包括可执行文件的名称。
String path4 = System.Windows.Forms.Application.StartupPath;
MessageBox.Show("获取启动了应用程序的可执行文件的路径,不包括可执行文件的名称:" + path4);

//获取启动了应用程序的可执行文件的路径及文件名
String path5 = System.Windows.Forms.Application.ExecutablePath;
MessageBox.Show("获取启动了应用程序的可执行文件的路径及文件名:" + path5);

}
}
}

回答2:

哦哦、