此代碼會引發錯誤。 我在代碼解釋錯誤:根據您的回答我的基於註釋的問題XmlReader中的堆棧溢出C#
public partial class Util
{
public string LoadFunctions()
{
string codeFunctionsString = "";
XmlReader reader = XmlReader.Create("fname2.xml");
//The line above throws an error:
//"An unhandled exception of type 'System.StackOverflowException' occurred in mscorlib.dll"
//The file DOES exist, so I don't know what the problem is.
reader.Read();
while (reader.Read())
{
reader.ReadToFollowing("item");
//reader.
codeFunctionsString += reader.Value + "|";
Form1 win = new Form1();
win.CodeInput.Text += reader.Value + " ";
}
return codeFunctionsString;
}
}
@patrick,你爲什麼有兩個? reader.read()??? – kobe 2011-02-26 17:07:45
@你可以發佈你的frame.xml內容 – kobe 2011-02-26 17:08:05
@patrick instantite一個來自util類的表單,這裏的東西非常錯誤?你應該從一個窗體,但不是相反的工具util類...它的壞設計 – kobe 2011-02-26 17:17:50