本文整理汇总了C#中IFile.WriteBinary方法的典型用法代码示例。如果您正苦于以下问题:C# IFile.WriteBinary方法的具体用法?C# IFile.WriteBinary怎么用?C# IFile.WriteBinary使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IFile
的用法示例。
在下文中一共展示了IFile.WriteBinary方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Export
public override void Export(IFile fileSystem, string rootPath)
{
string folderPath = GetFolder(rootPath);
fileSystem.CreateDirectoryWithoutReadOnly(folderPath);
string fileFullPath = System.IO.Path.Combine(folderPath, GetExportedFilename());
fileSystem.WriteBinary(fileFullPath, content);
}
示例2: Export
public override void Export(IFile fileSystem, string rootPath)
{
string exportPath = GetFolder(rootPath);
fileSystem.CreateDirectoryWithoutReadOnly(exportPath);
for (int i = 0; i < elementList.Count; i++)
{
string imageFileName = i.ToString() + ".png";
fileSystem.WriteBinary(System.IO.Path.Combine(exportPath, imageFileName), elementList[i]);
_data.exportedImageNameList.Add(imageFileName);
}
string indexJson = JsonConvert.SerializeObject(_data, Formatting.Indented);
fileSystem.WriteText(System.IO.Path.Combine(exportPath, INDEX_FILENAME), indexJson);
}
示例3: Export
public override void Export(IFile fileSystem, string rootPath)
{
string folderPath = GetFolder(rootPath);
fileSystem.CreateDirectoryWithoutReadOnly(folderPath);
List<NamedElementFilename> filenameList = new List<NamedElementFilename>();
for (int i = 0; i < elementList.Count; i++)
{
string filename = System.IO.Path.Combine(folderPath, i.ToString());
fileSystem.WriteBinary(filename, elementList[i].content);
filenameList.Add
(
new NamedElementFilename
{
name = elementList[i].name,
filename = filename
}
);
}
string indexFullPath = System.IO.Path.Combine(folderPath, GetIndexFilename());
string indexJson = JsonConvert.SerializeObject(filenameList);
fileSystem.WriteText(indexFullPath, indexJson);
}