我們循環這個方法切換到AWS我得到一個奇怪的錯誤後,現在的工作:通過字典項iTextSharp的
public static Dictionary<string, string> GetFormFieldNames(string pdfPath)
{
var fields = new Dictionary<string, string>();
foreach (DictionaryEntry entry in reader.AcroFields.Fields)
{
fields.Add(entry.Key.ToString(), string.Empty);
}
return fields;
}
Cannont convert type
System.Collections.Generic.KeyValuePair<String.iTextSharp.text.pdf.AcroFields.item>
toSystem.CollectionsEntry
我理解錯誤是顯而易見的,但我似乎無法得到輸入正確的。爲什麼這種方法停止工作?我在這裏做錯了什麼?
你可以使用var(代替DictionaryEntry),然後使用intellisense在你的字典中得到正確的值嗎? – thinklarge
@thinklarge我做了你的建議,並表示感謝!如果您將其作爲答案,我會將其標記爲已回答。我無法想象現在有多少個itext用戶可能會遇到這個問題。 – MizAkita
感謝您的回覆。出於這個原因,我喜歡C#的工具。 Intellisense使新庫的學習曲線變得更加容易。 – thinklarge