gpt4 book ai didi

c# - 如何检查 *.chm 文件中是否存在特定主题?

转载 作者:行者123 更新时间:2023-11-30 13:04:34 26 4
gpt4 key购买 nike

我正在以这种方式运行我的帮助文件:

Help.ShowHelp(null, @"help.chm", topicKeyword);

topicKeyword 是主题的通用名称,在某些情况下,该主题可能不存在于 help.chm 文件中。我想先检查这个主题是否存在,否则用户将得到 chm-file 但有错误的页面/主题。

最佳答案

你可以使用 jedwing CHMLib枚举 CHM 文件中的主题。例如:

static int CallBack( struct chmFile *h, struct chmUnitInfo *pUI, void *context )
{
printf( "%s\n", pUI->path );

return CHM_ENUMERATOR_CONTINUE;
}

int main()
{
chmFile *pFile = chm_open( "<Path to your CHM file>" );
if ( pFile )
{
chm_enumerate( pFile, CHM_ENUMERATE_NORMAL, CallBack, 0 );

chm_close( pFile );
}

return 0;
}

一旦您枚举了主题,您就可以根据您的枚举检查候选 url。

关于c# - 如何检查 *.chm 文件中是否存在特定主题?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8402523/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com