用c#程序搜索播放列表 [英] searching playlist with c# program

查看:134
本文介绍了用c#程序搜索播放列表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望我的程序在计算机内搜索并找到播放列表并运行执行所需的播放列表。

I want my program Search inside computer And find playlists and Run execute the desired playlist.

推荐答案

所以...假设你知道播放列表有什么扩展名(例如* .playlist)

So...assuming you know what extension the playlists have (for example *.playlist)
string rootpath = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments);
string[] files = Directory.GetFiles(rootpath, "*.playlist", SearchOption.AllDirectories);

将在当前用户MyDocuments下找到所有此类文件。

然后您可以执行播放列表(如果它具有适当的文件扩展程序分配:

will find all such files under the current user MyDocuments.
You can then execute a playlist (if it has an appropriate file extension program assignment:

Process.Start(files[myPlayListIndex]);



如果没有,你将不得不找到如何将播放列表传递给你想要使用的应用程序 - 它们的行为并不一样。


If it doesn't, you will have to find out how to pass a playlist to the app you want to use - they don't all behave the same way.


这篇关于用c#程序搜索播放列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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