public static string LoadLog(bool removeExisting) { using (var storageManager = new IsolatedStorageManager()) { string text; using (var stream = storageManager.OpenFile("ServiceMode.log", IO.OpenFileMode.Open)) { var reader = new StreamReader(stream); text = reader.ReadToEnd(); } if (removeExisting) { storageManager.DeleteFile("ServiceMode.log"); } return(text); } }