Excel把数据存入共享字符串文件中并返回该字符串的下标

         public static int InsertSharedStringItem(string text, pkg.SharedStringTablePart shareStringPart)
{
if (shareStringPart.SharedStringTable == null)
{
shareStringPart.SharedStringTable = new DOS.SharedStringTable();
} int i = ; foreach (DOS.SharedStringItem item in shareStringPart.SharedStringTable.Elements<DOS.SharedStringItem>())
{
if (item.InnerText == text)
{
return i;
}
i++;
} shareStringPart.SharedStringTable.AppendChild(new DOS.SharedStringItem(new DOS.Text(text)));
shareStringPart.SharedStringTable.Save(); return i;
}
上一篇:web安全之sql注入原理


下一篇:counting objects in class