本文整理汇总了C#中Spartacus.CompleteFileName方法的典型用法代码示例。如果您正苦于以下问题:C# Spartacus.CompleteFileName方法的具体用法?C# Spartacus.CompleteFileName怎么用?C# Spartacus.CompleteFileName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Spartacus
的用法示例。
在下文中一共展示了Spartacus.CompleteFileName方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CompressDirectory
/// <summary>
/// Cria um arquivo ZIP a partir de um diretório, no diretório pai do mesmo diretório.
/// </summary>
/// <returns>Arquivo ZIP.</returns>
/// <param name="p_zipfilename">Nome do arquivo ZIP a ser criado.</param>
/// <param name="p_directory">Diretório a ser compactado.</param>
public Spartacus.Utils.File CompressDirectory(string p_zipfilename, Spartacus.Utils.File p_directory)
{
Spartacus.ThirdParty.ZipStorer v_zipstorer;
Spartacus.Utils.File v_zipfiletmp, v_zipfile;
Spartacus.Utils.FileArray v_filearray;
System.IO.FileInfo v_fileinfo;
if (p_directory.v_pathseparator == Spartacus.Utils.PathSeparator.SLASH)
v_zipfiletmp = new Spartacus.Utils.File(1, 1, Spartacus.Utils.FileType.FILE, p_directory.v_path + "/" + p_zipfilename);
else
v_zipfiletmp = new Spartacus.Utils.File(1, 1, Spartacus.Utils.FileType.FILE, p_directory.v_path + "\\" + p_zipfilename);
try
{
v_zipstorer = Spartacus.ThirdParty.ZipStorer.Create(v_zipfiletmp.CompleteFileName(), "Generated with ZipStorer (by Jaime Olivares) embedded in Spartacus (by William Ivanski)");
v_zipstorer.EncodeUTF8 = true;
v_filearray = new Spartacus.Utils.FileArray(p_directory.CompleteFileName(), "*", System.IO.SearchOption.AllDirectories);
foreach (Spartacus.Utils.File v_file in v_filearray.v_files)
v_zipstorer.AddFile(Spartacus.ThirdParty.ZipStorer.Compression.Deflate, v_file.CompleteFileName(), v_file.CompleteFileName().Replace(p_directory.v_path, ""), "");
v_zipstorer.Close();
v_fileinfo = new System.IO.FileInfo(v_zipfiletmp.CompleteFileName());
v_zipfile = new Spartacus.Utils.File(1, 1, Spartacus.Utils.FileType.FILE, v_zipfiletmp.CompleteFileName(), v_fileinfo.LastWriteTime, v_fileinfo.Length);
}
catch (System.Exception e)
{
throw new Spartacus.Utils.Exception(e);
}
return v_zipfile;
}