using (IsolatedStorageFile isf = IsolatedStorageFile.GetUserStoreForApplication())
{
//判断文件是否存在
if (!isf.FileExists(Used.strKeyPath))
{
//创建文件夹
isf.CreateDirectory(Used.strMainPath);
//创建注册文件
StreamWriter writerKey = new StreamWriter(new IsolatedStorageFileStream(Used.strSignInPath, FileMode.OpenOrCreate, isf));
writerKey.WriteLine("1");
writerKey.Close();
}
//读取文件内容
if (!isf.DirectoryExists(Used.strSignInPath))
{
StreamReader reader = new StreamReader(new IsolatedStorageFileStream(Used.strSignInPath, FileMode.Open, isf));
Used.strSignIn = reader.ReadLine();
}
}