本文整理汇总了C#中PropVariant.GetObject方法的典型用法代码示例。如果您正苦于以下问题:C# PropVariant.GetObject方法的具体用法?C# PropVariant.GetObject怎么用?C# PropVariant.GetObject使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PropVariant
的用法示例。
在下文中一共展示了PropVariant.GetObject方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ListOrExtract
private static void ListOrExtract(string archiveName, uint level)
{
using (SevenZipFormat Format = new SevenZipFormat(SevenZipDllPath))
{
IInArchive Archive = Format.CreateInArchive(SevenZipFormat.GetClassIdFromKnownFormat(KnownSevenZipFormat.Zip));
if (Archive == null)
return;
try
{
using (InStreamWrapper ArchiveStream = new InStreamWrapper(File.OpenRead(archiveName)))
{
IArchiveOpenCallback OpenCallback = new ArchiveOpenCallback();
// 32k CheckPos is not enough for some 7z archive formats
ulong CheckPos = 128 * 1024;
if (Archive.Open(ArchiveStream, ref CheckPos, OpenCallback) != 0)
//ShowHelp();
if (!Directory.Exists(@"tmp_dir"))
Directory.CreateDirectory(@"tmp_dir");
//Console.WriteLine(archiveName);
uint Count = Archive.GetNumberOfItems();
for (uint I = 0; I < Count; I++)
{
PropVariant Name = new PropVariant();
Archive.GetProperty(I, ItemPropId.kpidPath, ref Name);
string FileName = (string)Name.GetObject();
Program.f1.label1.Text = FileName;
Application.DoEvents();
for(int i = 0; i < level; i++)
Console.Write("\t");
Console.Write(FileName + "\n");
FileName += level;
Archive.Extract(new uint[] { I }, 1, 0, new ArchiveExtractCallback(I, FileName));
Program.Determine_Parser(new System.IO.FileInfo("tmp_dir//" + FileName), level);
}
}
}
finally
{
Marshal.ReleaseComObject(Archive);
Directory.Delete(@"tmp_dir", true);
}
}
}