![c debugging questions pdf c debugging questions pdf](https://media.cheggcdn.com/study/735/735f893a-2261-4d11-b200-cc70fe17bf61/image.png)
Imagine that you have a FileInfo for the file c:\temp\example.pdf. If you specify a file name only in path, GetFullPath returns the fully qualified path of the current directory. This method uses current directory and current volume information to fully qualify path. The documentation for Path.GetFullPath states (emphasis mine again):
C debugging questions pdf pdf#
To answer the question in your edit - you are getting FileInfo objects for all pdf files in C:\temp but you are then using System.IO.Path.GetFullPath(archivopdf.Name) to get the file path to pass to archivo.LecturaPDF. To archivo.LecturaPDF(System.IO.Path.GetFullPath(dialogoArchivo.FileNames)), In your context you'd need to change this line: archivo.LecturaPDF(System.IO.Path.GetFullPath(dialogoArchivo.SafeFileNames)), If no files are selected, this method returns an empty array.
C debugging questions pdf full#
If you know the directory that the file should be chosen from you could add it to the file name (using Path.Combine) but if you would prefer the full path you can use the FileNames property which according to the documentation (again, emphasis mine):Įach file name includes both the file path and the extension. The file names do not include the path.Īs it doesn't contain the path, the current path will be used which when you're running in the debugger will be bin\debug by default. Gets an array of file names and extensions for all the selected files in the dialog box. I change the function to automatically read all the file in a specific folder and process every file.Ĭ:\user\me\MyDocuments\Projects\Project1\bin\debug\test.pdf not foundįrom the documentation of OpenFileDialog.SafeFileNames (emphasis mine):
![c debugging questions pdf c debugging questions pdf](https://elizabethsid.org/img/559676.jpg)
(DispatcherPriority.Background, (Action)(() => lblEstado.Content =Īrchivo.InsercionArchivo(archivopdf.Name, G_Fecha,Īrchivo.LecturaPDF(System.IO.Path.GetFullPath(archivopdf.Name)),
![c debugging questions pdf c debugging questions pdf](https://d20ohkaloyme4g.cloudfront.net/img/document_thumbnails/3f4abe8280889e60f91fa26b73e6a797/thumb_1200_1697.png)
C debugging questions pdf update#
UPDATE private void cmdProcesar_Automatico(object sender, RoutedEventArgs e)ĭirectoryInfo dir = new DirectoryInfo(carpeta) įileInfo documentos = dir.GetFiles("*.pdf") įoreach (FileInfo archivopdf in documentos) This is my first time with C# and I don't know why only works wwhen I read the files from the project debug folder "Procesando archivos contra Billing.")) Īrchivo.InsercionArchivo(dialogoArchivo.SafeFileNames, G_Fecha,Īrchivo.LecturaPDF(System.IO.Path.GetFullPath(dialogoArchivo.SafeFileNames)), PdfReader lectorPDF = new PdfReader(nombreArchivo) public string LecturaPDF(string nombreArchivo) I need to load the PDF files from any folder. the folder is the debug folder of the project. The application make works good only when the PDF files are in a specific folder. I am trying to read some PDF files and load the data into a database.