|
-
May 5th, 2011, 02:46 AM
#1
Thread Starter
New Member
Modify Properties Of Text File
I have the same problem with fileName.txt and fileName.dat.
did you get any relevant unswer??
did you find any solution for this problem?
 Originally Posted by Shaitan00
Goal:
Given a Text File “Test.dat”, I need to retrieve the date on which the file was last Modified & Copied to a specific location,
Problem:
The file can be transferred (copied) via any method to the specific location and must retain the required information however protocols like FTP change/destroy the original Created/Modified/Accessed date thus rendering them useless.
Possible Solution:
Use one of the other fields (in Summary for example: Keywords or Comments) to store the Timestamp prior to copy, this way windows should not be able to destroy the information. Please confirm.
Create a new field (in Summary for example) to store the timestamp. Please confirm.
Given these requirements, if it is even possible, how could I write/read from the File Information, like the File Summary Properties for example?
-
May 5th, 2011, 11:38 AM
#2
Re: Access/Modify File Info/Properties of a Text File [C#]
Need to re-register ASP.NET?
C:\WINNT\Microsoft.NET\Framework\v#VERSIONNUMBER#\aspnet_regiis -i
(Edit #VERSIONNUMBER# as needed - do a DIR if you don't know)
-
May 8th, 2011, 03:23 PM
#3
Thread Starter
New Member
Re: Access/Modify File Info/Properties of a Text File [C#]
Thanks,
It was very useful with c#.
I guss, because the dll was written in c++, it has to be easier to use it in c++, am i right?? (Please confirm)
Can you please tell me how can i do the same in c++??
(Code example wiil be received with pleasure )
-
May 8th, 2011, 05:26 PM
#4
Addicted Member
Re: Access/Modify File Info/Properties of a Text File [C#]
With this code, you can access more than 255 properties of any file
Code:
Shell32.Shell shell = new Shell32.Shell();
Shell32.Folder objFolder;
objFolder = shell.NameSpace(Path.GetDirectoryName(FilePath));
foreach (Shell32.FolderItem2 item in objFolder.Items())
if (item.Name == Name + "." + FileFormat)
{
Length = objFolder.GetDetailsOf(item, 27);
Height = objFolder.GetDetailsOf(item, 280);
Width = objFolder.GetDetailsOf(item, 282);
}
BOLD is what I used in one app to retrive video info, the numbers 27,280,282 are Property ID, you can go through this with debugger and you will find property and it's ID.
-
May 11th, 2011, 03:01 AM
#5
Thread Starter
New Member
Re: Access/Modify File Info/Properties of a Text File [C#]
first of all, thank you!
how can i do it with c++ ? - by using shell32.dll...
can you give me a code example in c++??
-
May 11th, 2011, 05:14 AM
#6
Addicted Member
Re: Access/Modify File Info/Properties of a Text File [C#]
 Originally Posted by newdeveloper
first of all, thank you!
how can i do it with c++ ? - by using shell32.dll...
can you give me a code example in c++??
I am sorry, I am not familiar with c++
-
May 11th, 2011, 09:20 AM
#7
Re: Modify Properties Of Text File
Split from a 6 year old thread into its own thread and moved to C++
-
May 11th, 2011, 11:30 AM
#8
Re: Modify Properties Of Text File
Could you explain exactly what it is you want? Reading the post you've quoted, it sounds like the OP wanted to create some sort of extra field in a file to store the last-modified date. Is this what you want to do?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|