我在互联网上发现此代码检查文件存在
using (var store = IsolatedStorageFile.GetUserStoreForApplication())
{
if (store.FileExists("Setting.xml"))
{
MessageBox.Show("have file");
}
else
{
MessageBox.Show("haven't file");
}
}
当我尝试时,它只显示条件“没有文件”。是否有Setting.xml文件? (我可以通过XDocument data = XDocument.Load(“Setting.xml”)加载这个文件;做或不做)?
答案 0 :(得分:0)
你能检查一下这个“Setting.xml”文件是在IsolatedStorage吗?
因为,为了从IsolatedStorage访问文件 - 你应该使用IsolatedStorageFileStream。