错误截图如下
我想发生的是动态创建一个 xml 文件,xml 的节点将是 string[] textBoxNamesArray
,值将是 string[] textBoxTextArray
如何解决这个问题?
最佳答案
问题在于对 String.Replace
的调用。 The first argument cannot be an empty string .并且由于您将 ""替换为 string.Empty
,所以实际上不需要调用,可以将其删除。
所以把这一行改成
xml.Add(new XElement(i, o));
关于c# - 在 C# 错误 "String cannot be of zero length. Parameter name: oldValue"中使用 linq to xml 创建动态 xml 文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13676934/