Questions tagged [system.io.fileinfo]

77 questions
0
votes
1 answer

new FileInfo corrupts FullName when path ends with space

I search files and return FileInfo as IEnumerable. I set a breakpoint in the Select and see the filename passed in is e:\mp3\MP3_Amazon\Orchestra della Scala di Milano, Tullio Serafin,Herbert von Karajan, Maria \Maria Callas, Vol 4\01-15- Madama…
Bernhard Döbler
  • 1,960
  • 2
  • 25
  • 39
0
votes
0 answers

Move File Causing Error he process cannot access the file because it is being used by another process

In my VB.net app, I want to move/Rename a file from folder1 to folder2. Like the following: System.IO.File.Move(Folder1 & "1.mp3", Folder2 & "NewName1.mp3") And then I want to move all the remaining files in folder1 to folder3 Sub…
HelpASisterOut
  • 3,085
  • 16
  • 45
  • 89
0
votes
1 answer

files cannot be modified after decompression

Sounds like read-only files, right? well not really. So my goal is to make a backup of all the files from an application I have build by simply compressing them to a .zip file. First I collect all files and put them in another folder (I don't need…
CularBytes
  • 9,924
  • 8
  • 76
  • 101
0
votes
2 answers

Unable to return List object

I am trying to return a list of type FileInfo by searching an arbitrary directory recursively. However, in my main() method, when I check to see the count of FoundFiles, it is 0 meaning I returned an empty object. See Code below: using System; using…
corneria
  • 608
  • 3
  • 11
  • 24
0
votes
1 answer

Get file details like title name

So I'm Building a search class, I need to get the title ("Titel" in picture) out from these files(see pic). Currently I'm getting the "Navn" from FileInfo.Name Can anyone help?
Sinnich
  • 342
  • 5
  • 17
0
votes
2 answers

File.Move on client machine Asp.net MVC

Silly question but here goes... Is it possible to write an intranet windows auth asp.net mvc app that uses File.Move to rename a file on a users machine? Or will the File.Move and using Path.GetDirectory and other System.IO functions look on the IIS…
MightyAtom
  • 331
  • 4
  • 24
0
votes
2 answers

What is the best way to rename (move) file system branches in .NET?

I would like to rename files and folders recursively by applying a string replacement operation. E.g. The word "shark" in files and folders should be replaced by the word "orca". C:\Program Files\Shark Tools\Wire Shark\Sharky 10\Shark.exe should be…
Klaus Graefensteiner
0
votes
1 answer

Reading the last line of a text file after FileSystemWatcher detects change

My earlier post was unreadable so. I am trying to read the last line of a text file every time it changes. The code I have is, private void fileSystemWatcherMCH1_Changed(object sender, System.IO.FileSystemEventArgs e) { string machState =…
0
votes
4 answers

How to convert FileInfo into FileInfo[]

I have been working on a program that requires a different approach to finish a job using try and catch nested within another try/catch. For this purpose I have had to create a set of files as strings and then converted them to…
Adsy2010
  • 525
  • 6
  • 23
0
votes
1 answer

how to open a a pdf file using fileinfo object of System.IO

I have mafe a simple object using fileInfo class as: DirectoryInfo myDirectory = new DirectoryInfo(@"d:\Books"); FileInfo[] files = myDirectory.GetFiles(); foreach (FileInfo file in files) { try { file.OpenRead(); break; …
Abhishek gupta
  • 463
  • 3
  • 12
  • 33
-1
votes
1 answer

Unable to retrieve the Author's information of a file using System.Io in C#

Unable to retrieve Author's information of a file using System.Io in C#. I tried with GetOwner() method and ii is always gives a static value. Kindly help me to get the Author's information under the File Properties which are under Details Tab.
-1
votes
1 answer

Illegal characters in path. Searching directories

I'm trying to read a file to get the path and then search that path. C:\Users\Public\Documents\ScriptPath.txt contains "C:\Users\Public\Music Folder\" and here is my code string ScriptPath =…
-1
votes
1 answer

IO.fileinfo Class usage in vb.net 2010

I am coding to watch a XYZ folder on the timer tick interval 30,000. If the XYZ folder have the filecount+1 then I want to copy a new file to process. I can code the rest but stuck at: Error 1 'filesindir' is not declared. It may be inaccessible…
-1
votes
1 answer

Copy files from Client Machine and save it to Webserver

Question 1: Suppose i have a file in c drive which is present in the Client Machine like c:\File.txt in a string variable. String str="C:\File.txt"; i need to save the str variable data to my server in one particular location . Question 2: If I use…
Naveen
  • 21
  • 7
-2
votes
3 answers

Exception while accessing FileInfo Class

I am trying to access all the files inside sub folders which are present inside a master folder, along with their last access times. I am able to get all the files, the problem arises when I'm trying to get the last access times. I receive the…
Anurag
  • 552
  • 9
  • 31