ItextSharp - Lowercase' 不明确,因为 class 'List' 中存在多种具有此名称的成员

ItextSharp - Lowercase' is ambiguous because multiple kinds of members with this name exist in class 'List'

我正在使用 vb.net,当我尝试将列表字母设置为小写时

mylist.lowercase = list.lowercase

我收到一个错误

小写字母不明确,因为 class 'List'

中存在多种同名成员

lowercaseprotected field on the List class so I'm pretty sure you mean the class constant LOWERCASE.

出于历史和向后兼容性的原因,VB.Net 语言是大小写不敏感,但是 CLR 的其余部分是大小写敏感 所以你必须意识到这一点。

无论如何,当使用该特定字段时,您将 运行 陷入冲突,因此最安全的做法是只使用该字段的值 True 代替它。如果这个错误你也可以浪费一堆额外的 CPU 周期并跳入反思,但我不推荐它:

''Bad code but works
mylist.lowercase = GetType(iTextSharp.text.List).GetField("LOWERCASE").GetValue(Nothing)

编辑

从评论中我现在看到是左侧导致了您的问题。只需使用 IsLowercase 属性 代替:

mylist.IsLowercase = True