public ActionResult About() { ViewBag.Message = "Your application description page."; var pstPath = @"C:\Users\aidas\OneDrive\Documents\Outlook Files\[email protected]"; var service = new PstReadingService(); service.ReadFile(pstPath); return(View()); }
private void ExatractInfo_Click(object sender, RoutedEventArgs e) { try { var filePath = FileNameTextBox.Text; if (!File.Exists(filePath)) throw new FileNotFoundException(); TextBlock1.Text = string.Empty; string inputFileName = filePath.Substring(filePath.LastIndexOf(@"\") + 1); string outputFileName = string.Empty; var pstService = new PstReadingService(filePath); if (FolderStructure.IsChecked != true && FolderItems.IsChecked != true) { TextBlock1.Text = "Select the type of information you want to extract"; } else if (FolderStructure.IsChecked == true) { outputFileName = $"{inputFileName} - FolderStructure.txt"; pstService.GetFoldersStructure(_outputFolderPath + outputFileName); PrintFileLocation(_outputFolderPath, outputFileName); } else if (FolderItems.IsChecked == true) { outputFileName = $"{inputFileName} - FolderItems.txt"; pstService.GetFolderItems(_outputFolderPath + outputFileName); PrintFileLocation(_outputFolderPath, outputFileName); } } catch (FileNotFoundException) { TextBlock1.Text = "File not found. Please try again!"; } }