About 6,090,000 results
Open links in new tab
  1. What is the difference between File and FileInfo in C#?

    File is optimized for one-off operations on a file, FileInfo is optimized around multiple operations on the same file, but in general there isn't that much difference between the different method …

  2. c# - Getting file names without extensions - Stack Overflow

    Jan 26, 2011 · I dislike the DirectoryInfo, FileInfo for this scenario. DirectoryInfo and FileInfo collect more data about the folder and the files than is needed so they take more time and …

  3. How to get File Created Date and Modified Date - Stack Overflow

    Apr 23, 2014 · I have an .NET EXE file . I want to find the file created date and modified date in C# application. Can do it through reflection or with IO stream?

  4. How to use FileInfo object from Powershell - Stack Overflow

    May 4, 2017 · 3 You can use Get-Item to allow PowerShell to select between FileInfo and DirectoryInfo. It will throw an exception if the path doesn't resolve to a location.

  5. What is difference between File.Exists("") and FileInfo exists

    Feb 26, 2014 · 2 The difference between File.Exists() and new FileInfo().Exists on it's behavior when full path (directory name + file name) is long:

  6. Rename a file in C# - Stack Overflow

    Jul 10, 2010 · NOTE: In this example code we open a directory and search for PDF files with open and closed parenthesis in the name of the file. You can check and replace any character …

  7. How do I get the directory from a file's full path? - Stack Overflow

    If you are working with a FileInfo object, then there is an easy way to extract a string representation of the directory's full path via the DirectoryName property.

  8. How to dispose an object created by class FileInfo?

    Oct 13, 2014 · I am using a FileInfo class to get the length of the file as follows: FileInfo infoFile = new FileInfo(@"C:\\Text12341234"); long configFileLength = infoFile.Length; I want to dispose …

  9. How can I get the FileInfo of all files in a folder with GetFile ()?

    FileInfo[] files = dir.GetFiles(); Also I suggest you to use Path.Combine for generating new file path and FileInfo.MoveTo method, which don't require source directory name:

  10. Permission errors in PowerShell - Stack Overflow

    Jul 12, 2016 · TargetObject : D:\path\file.txt CategoryInfo : PermissionDenied: (D:\path\file.txt:FileInfo) [Remove-Item], IOException FullyQualifiedErrorId : …