Click here to Skip to main content
11,705,052 members (53,422 online)
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C#4.0
Hi Friends,

I want to display Author name of file or name of user who created the file. So i want to access it through file properties using C# langauge. How can I achive it?

Thanks,
Hanumant
Posted 16-Dec-12 20:19pm
Edited 16-Dec-12 21:01pm
v2
Comments
OriginalGriff at 17-Dec-12 2:26am
   
This is not a good question - we cannot work out from that little what you are trying to do.
Remember that we can't see your screen, access your HDD, or read your mind.
It would probably help if (for example) you told us what format the file was in...
Use the "Improve question" widget to edit your question and provide better information.
Hanumant Gade at 17-Dec-12 3:02am
   
I did it.
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

string author = File.GetAccessControl(path).GetOwner(typeof(System.Security.Principal.NTAccount)).ToString();
or else
http://stackoverflow.com/questions/153087/getting-setting-file-owner-in-c-sharp[^]
  Permalink  
Comments
Hanumant Gade at 17-Dec-12 2:59am
   
Thanks Krunal Rohit for reply. The above code gives author as Administrators. I want real Author of File or name of user who created the file. So how can I achive it?
Krunal Rohit at 17-Dec-12 3:02am
   
have you tried that link ?
Hanumant Gade at 17-Dec-12 3:23am
   
yes..allready I tried it. Now I got solution. I have updated it in this thread.
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 3

Using Shell32.dll we can solve the above issue. Using ShellClass object we will get all the file details. please go through Retrieve detailed information of a File[^]


Thanks,
Hanumant
  Permalink  
v3

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 609
1 OriginalGriff 439
2 Andy Lanng 215
3 CPallini 202
4 F-ES Sitecore 160
0 OriginalGriff 8,958
1 Sergey Alexandrovich Kryukov 8,276
2 CPallini 5,189
3 Maciej Los 4,726
4 Mika Wendelius 3,606


Advertise | Privacy | Mobile
Web03 | 2.8.150819.1 | Last Updated 17 Dec 2012
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100