本文整理汇总了C#中ICSharpCode.SharpZipLib.Zip.ZipNameTransform.TransformFile方法的典型用法代码示例。如果您正苦于以下问题:C# ZipNameTransform.TransformFile方法的具体用法?C# ZipNameTransform.TransformFile怎么用?C# ZipNameTransform.TransformFile使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ICSharpCode.SharpZipLib.Zip.ZipNameTransform
的用法示例。
在下文中一共展示了ZipNameTransform.TransformFile方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: NameTransforms
public void NameTransforms()
{
INameTransform t = new ZipNameTransform(@"C:\Slippery");
Assert.AreEqual("Pongo/Directory/", t.TransformDirectory(@"C:\Slippery\Pongo\Directory"), "Value should be trimmed and converted");
Assert.AreEqual("PoNgo/Directory/", t.TransformDirectory(@"c:\slipperY\PoNgo\Directory"), "Trimming should be case insensitive");
Assert.AreEqual("slippery/Pongo/Directory/", t.TransformDirectory(@"d:\slippery\Pongo\Directory"), "Trimming should be case insensitive");
Assert.AreEqual("Pongo/File", t.TransformFile(@"C:\Slippery\Pongo\File"), "Value should be trimmed and converted");
}
示例2: PathalogicalNames
public void PathalogicalNames()
{
string badName = ".*:\\zy3$";
Assert.IsFalse(ZipNameTransform.IsValidName(badName));
ZipNameTransform t = new ZipNameTransform();
string result = t.TransformFile(badName);
Assert.IsTrue(ZipNameTransform.IsValidName(result));
}
示例3: TestFile
void TestFile(ZipNameTransform t, string original, string expected)
{
string transformed = t.TransformFile(original);
Assert.AreEqual(expected, transformed, "Should be equal");
}