朋友们请你检查一下这段代码并告诉我为什么我得到一个FileNotFoundException
和PathIsIllegal
例外......?
void AddSearchTermLog(String term)
{
String data = File.ReadAllText(global::BenisImageDownloader.Properties.Resources.SearchTerms);
if (data != String.Empty)
{
String temp = String.Empty;
for (int i = 0; i < data.Length; i++)
{
if (data[i] == (char)Keys.Enter)
{
if (temp == term)
return;
temp = String.Empty;
}
else
temp += data[i];
}
}
File.AppendAllText(global::BenisImageDownloader.Properties.Resources.SearchTerms, term + Environment.NewLine);
}
如果我做错了什么,请用正确的方法纠正我..