Visual Basic 2010开放资源 [英] Visual Basic 2010 Open Resources

查看:74
本文介绍了Visual Basic 2010开放资源的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨!我对vb有一点问题.您知道如何打开自己的资源吗?例如:我有一首名为"test.mp3"的歌曲.我想在我的里面打开 音乐的默认程序.我不希望它在后台播放.我要打开它.因为我考虑过将其放入解决方案中,并使用代码:

Hey guys! I have a little problem with vb. Do you have any idea how do I open my own resources? For example: I have a song named "test.mp3". I want it to open in my default program for music. I don't want it to play in background. I want it to open. Because I thought about putting it in the solution, and using the code:

 

System.Diagnostics.Process.Start("test.mp3")

System.Diagnostics.Process.Start ("test.mp3")

 

但是它不起作用:(

 

我该怎么办?我需要一个代码(不管它有多长,我都需要它来 工作)

What should I do? I need a code (doesn't matter how long it is, I need it to work)

推荐答案

将其转换为WAV(Microsoft编码)

Convert it to a WAV (microsoft encoding)

要复制并执行

项目属性资源声音

将其放在其中.

比你能得到的

My.Resources.TheNameOfTheWav

My.Resources.TheNameOfTheWav

您可以使用它来更好地播放最新的媒体课程,因为您有更多的可能性

You can use to play it the best the newer media class, because you have more possibilities with that one 


  Dim Sound As New System.Media.SoundPlayer(My.Resources.MyWav)
  Sound.Play()


这篇关于Visual Basic 2010开放资源的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆