Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/vb.net/14.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
VB.NET-将MP3转换为Base64字符串_Vb.net_Audio_Base64_Mp3 - Fatal编程技术网

VB.NET-将MP3转换为Base64字符串

VB.NET-将MP3转换为Base64字符串,vb.net,audio,base64,mp3,Vb.net,Audio,Base64,Mp3,我正试图找到一种将mp3声音存储在文本文件中的方法。我的计划是将原始mp3文件转换为base64字符串,然后保存它 我花了很多时间询问谷歌,但只能找到将base64字符串转换回mp3的方法 这可能吗?我也为其他解决方案开放,我只需要能够将文件转换为文本,然后返回到mp3格式。我正在使用Visual Basic.NET,但我认为C也可以帮我解决问题。使用将字节数组转换为base64字符串: ' load file into a byte array Dim data As Byte() = Fil

我正试图找到一种将mp3声音存储在文本文件中的方法。我的计划是将原始mp3文件转换为base64字符串,然后保存它

我花了很多时间询问谷歌,但只能找到将base64字符串转换回mp3的方法

这可能吗?我也为其他解决方案开放,我只需要能够将文件转换为文本,然后返回到mp3格式。我正在使用Visual Basic.NET,但我认为C也可以帮我解决问题。

使用将字节数组转换为base64字符串:

' load file into a byte array
Dim data As Byte() = File.ReadAllBytes(filename)
' convert the byte array to base64
Dim str As String = Convert.ToBase64String(data)
' write the string to a file
File.WriteAllText(newFilename, str)