Tech
Forums
Jobs
Books
Events
Live
Interviews
More
Learn
Training
Career
Members
Videos
News
Blogs
Login
Sign Up
Ask Question
3
Reply
listview to return filename and file owner
steve potts
Aug 7 2012 5:13 AM
2.2k
Reply
I have a listview, and currently i return the filenames like this..
foreach (string file in files)
{
if (System.Text.RegularExpressions.Regex.IsMatch(file, sPattern, System.Text.RegularExpressions.RegexOptions.IgnoreCase))
{
listView1.Items.Add(file);
}
what i would like to do is also be able to retrive the file owner, which i think i can do with this code, but im not sure how to do it along side my existing code and get into the listview alongside the filename?
this gets the file owner i think..
System.IO.File.GetAccessControl(file).GetOwner(typeof(System.Security.Principal.NTAccount)).ToString();
thanks, steve.
Upload Source Code
Select only zip and rar file.
Post
Reset
Cancel
Answers (
3
)
Next Recommended Forum
Displaying PDF documents in a visual C# application
I do not know where I went wrong, Could some one help me please