12. C# 文件操作

  string[] path = Directory.GetFiles(@path,"*.jpg");// 获取目录下的所有jpg文件

 

播放音乐

1 //
2     // 摘要:
3     //     控制 .wav 文件中的声音播放。
4     [ToolboxItem(false)]
5     public class SoundPlayer : Component, ISerializable
6     {
7       }
View Code

 可能的错误

1).C#异常提示.mp3的文件不是一个有效的波形文件 https://blog.csdn.net/weixin_44031029/article/details/104881331

2.文件读写操作

//读取
byte[] buffer = File.ReadAllBytes(@"filePath");
Console.ReadKey();

 ////写入
//File.WriteAllBytes(@"newFilePath", buffer);

 

3.

posted @ 2020-07-27 18:48  客饭  阅读(118)  评论(0)    收藏  举报