Пример #1
0
        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());
        }
Пример #2
0
        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!";
            }
        }