public static void WriteBytes(byte[] vs, string filePath, FileOperater operater = default) { FileOperater fileOperater = (operater == null) ? new FileOperater() : operater; FileCommandInfo fileCommandInfo = new FileCommandInfo { FileFullName = filePath, FileReadType = FileCommandInfo.FileCommandInfoReadType.Bytes, DataBytes = vs }; fileOperater.WriteFile(ref fileCommandInfo); fileCommandInfo.Dispose(); }
public static void WriteUTF8Text(string content, string filePath, FileOperater operater = default) { FileOperater fileOperater = (operater == null) ? new FileOperater() : operater; FileCommandInfo fileCommandInfo = new FileCommandInfo { FileFullName = filePath, FileReadType = FileCommandInfo.FileCommandInfoReadType.Bytes, DataBytes = Encoding.UTF8.GetBytes(content) }; fileOperater.WriteFile(ref fileCommandInfo); fileCommandInfo.Dispose(); }