首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > .NET > C# >

AxWindowsMediaPlayer 的URL路径写什么?该怎么解决

2013-11-14 
AxWindowsMediaPlayer 的URL路径写什么?AxWindowsMediaPlayer 的URL路径写什么,是mp3的路径么?AxWindowsMe

AxWindowsMediaPlayer 的URL路径写什么?
AxWindowsMediaPlayer 的URL路径写什么,是mp3的路径么?


AxWindowsMediaPlayer mediaPlayer = new AxWindowsMediaPlayer() ;
mediaPlayer.URL = "D:\\mp3\\Kalimba.mp3";
mediaPlayer.uiMode = "None";
mediaPlayer.Ctlenabled = true;
mediaPlayer.Ctlcontrols.play();


这URL怎么错了 ,应该怎么写。
文件路径没问题 C#
[解决办法]
短格式的路径,你自己百度吧。
在widnows里有个api函数可以获取短格式的路径。
引用:
  [DllImport("Kernel32", CharSet = CharSet.Auto)]
        static extern Int32 GetShortPathName(String path,StringBuilder shortPath, Int32 shortPathLength);

 调用:     
            StringBuilder shortpath=new StringBuilder(80);
            int result = GetShortPathName(MusicFile, shortpath, shortpath.Capacity);
            MusicFile = shortpath.ToString();

MusicFile,这个参数是你现在的路径。
shortpath,这个参数是api函数返回的短路径。

热点排行