TheSwamp

Code Red => .NET => Topic started by: uncoolperson on May 19, 2006, 03:25:03 PM

Title: get username of last to modify file
Post by: uncoolperson on May 19, 2006, 03:25:03 PM
trying to get the last user to modify a file to go with the date... but i'm having issues trying to come up with the username of the last user to modify a file

any ideas....
Title: Re: get username of last to modify file
Post by: uncoolperson on June 15, 2006, 03:41:56 PM
so i was thinking yesterday... you know what this thing is missing


Title: Re: get username of last to modify file
Post by: David Hall on June 15, 2006, 03:51:17 PM
what about capturing the username on exit, then the next person in can read that value, and when they exit, it would update to the value
Title: Re: get username of last to modify file
Post by: uncoolperson on June 15, 2006, 04:17:12 PM
about 75% of our users are lt...

and this is an executable, and i'm trying to keep the functionality for all file types
Title: Re: get username of last to modify file
Post by: Bob Wahr on June 15, 2006, 04:22:13 PM
Echos of B3 If you can get it, it's stored in the file somewhere if you can find it.  How was that for absolutely no help whatsoever?
Title: Re: get username of last to modify file
Post by: uncoolperson on June 15, 2006, 04:27:16 PM
Echos of B3

what now?
Title: Re: get username of last to modify file
Post by: Bob Wahr on June 15, 2006, 04:31:13 PM
It was a project in another place and time called Byte By Byte (BBB, B3) in which Randall Rath was trying to teach a few brave and intelligent people how to get the information they needed from drawing files without the need of opening the drawing files.
Title: Re: get username of last to modify file
Post by: uncoolperson on June 15, 2006, 04:32:18 PM
few brave and intelligent people

yup, not me

*runs and hides, with my blankie*
Title: Re: get username of last to modify file
Post by: Bob Wahr on June 15, 2006, 04:32:58 PM
me either
Title: Re: get username of last to modify file
Post by: uncoolperson on June 15, 2006, 04:35:54 PM
Code: [Select]
FileInfo thefile = new FileInfo(file);

FileSecurity FileSec = new FileSecurity(file, AccessControlSections.Owner);

NTAccount ownerobj = (NTAccount)FileSec.GetOwner(Type.GetType("System.Security.Principal.NTAccount"));

string modifieduser = ownerobj.Value.Substring(ownerobj.Value.IndexOf("\\") + 1);


so far what i have is this, might just have to go with it...
Title: Re: get username of last to modify file
Post by: Bob Wahr on June 15, 2006, 04:37:08 PM
If I remember correctly, the Australian contingent (Kerry Brown, MickD, GlennR), Cornbread, and Hatch (who sadly has never appeared here, I can't find his email address so if anyone has it, shoot him an email) were all playing along.  I did a lot of thread reading with glazed eyes and a slack jaw, saying, "whuh?"