32 lines
702 B
C#
32 lines
702 B
C#
using System.IO;
|
|
|
|
namespace MyUtility
|
|
{
|
|
public static class UtilityPlatformIO
|
|
{
|
|
public static void SaveToFile(string p_filePath, byte[] p_fileContents)
|
|
{
|
|
using (FileStream fileStream = File.Open(p_filePath, FileMode.Create))
|
|
{
|
|
fileStream.Write(p_fileContents, 0, p_fileContents.Length);
|
|
}
|
|
}
|
|
|
|
public static void SaveToFile(string p_filePath, string p_fileContentAsString)
|
|
{
|
|
using (FileStream stream = File.Open(p_filePath, FileMode.Create))
|
|
{
|
|
using (StreamWriter streamWriter = new StreamWriter(stream))
|
|
{
|
|
streamWriter.Write(p_fileContentAsString);
|
|
}
|
|
}
|
|
}
|
|
|
|
public static string FixFilePath(string p_path)
|
|
{
|
|
return "file:///" + p_path;
|
|
}
|
|
}
|
|
}
|