You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
using AKSWebBrowser.Commen;
|
|
|
|
using CPF.Controls;
|
|
|
|
using System;
|
|
|
|
using System.Drawing;
|
|
|
|
using System.IO;
|
|
|
|
|
|
|
|
namespace AksWebBrowser.Common
|
|
|
|
{
|
|
|
|
public class Utils
|
|
|
|
{
|
|
|
|
/// <summary>
|
|
|
|
/// 消息弹框
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="mes"></param>
|
|
|
|
public static void MessagesBox(string mes) {
|
|
|
|
MessageBox.ShowSync(mes);
|
|
|
|
}
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// base64转文件
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="base64String"></param>
|
|
|
|
/// <param name="filePath"></param>
|
|
|
|
public static void Base64StringToFile(string base64String, string filePath)
|
|
|
|
{
|
|
|
|
// 将base64字符串转换为字节数组
|
|
|
|
byte[] wavBytes = Convert.FromBase64String(base64String);
|
|
|
|
|
|
|
|
// 将字节数组写入到wav文件
|
|
|
|
using (FileStream fileStream = new FileStream(filePath, FileMode.Create, FileAccess.Write))
|
|
|
|
{
|
|
|
|
fileStream.Write(wavBytes, 0, wavBytes.Length);
|
|
|
|
fileStream.Flush();
|
|
|
|
fileStream.Close();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|