Click here to Skip to main content
13,508,889 members
Rate this:
Please Sign up or sign in to vote.
See more:
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?

Posted 16-Dec-12 20:19pm
Updated 16-Dec-12 21:01pm
OriginalGriff 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 17-Dec-12 3:02am
I did it.
Rate this: bad
Please Sign up or sign in to vote.

Solution 1

string author = File.GetAccessControl(path).GetOwner(typeof(System.Security.Principal.NTAccount)).ToString();

or else[^]
Hanumant Gade 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 17-Dec-12 3:02am
have you tried that link ?
Hanumant Gade 17-Dec-12 3:23am
yes..allready I tried it. Now I got solution. I have updated it in this thread.
Rate this: bad
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[^]


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

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web02 | 2.8.180417.1 | Last Updated 17 Dec 2012
Copyright © CodeProject, 1999-2018
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