本文整理汇总了C#中ICSharpCode.SharpZipLib.Zip.ZipNameTransform.TransformDirectory方法的典型用法代码示例。如果您正苦于以下问题:C# ZipNameTransform.TransformDirectory方法的具体用法?C# ZipNameTransform.TransformDirectory怎么用?C# ZipNameTransform.TransformDirectory使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ICSharpCode.SharpZipLib.Zip.ZipNameTransform
的用法示例。
在下文中一共展示了ZipNameTransform.TransformDirectory方法的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: TooLong
public void TooLong()
{
ZipNameTransform zt = new ZipNameTransform();
string veryLong = new string('x', 65536);
try {
zt.TransformDirectory(veryLong);
Assert.Fail("Expected an exception");
}
catch (PathTooLongException) {
}
}
示例3: LengthBoundaryOk
public void LengthBoundaryOk()
{
ZipNameTransform zt = new ZipNameTransform();
string veryLong = "c:\\" + new string('x', 65535);
try {
zt.TransformDirectory(veryLong);
}
catch {
Assert.Fail("Expected no exception");
}
}