I'm writing a service that copies specific MS Office documents(.doc, .xls,.mdb) after any event triggers a file system watcher (Change, Deleted, Renamed, Changed) and logs those file operations
to a xml file. In order to copy those files to a hidden folder located in the user's My Documents Folder I was using in my windows form testing environment Environment.GetFolderPath(Environment.SpecialFolder.Personal) and it worked perfectly and in
order to determine the logged user I was using WindowsIdentity.GetCurrent().Name and when I
tryied using them in the Windows Service code none of them worked as expected, Environment.GetFolderPath Environment.SpecialFolder.Personal) returns nothing at all and
WindowsIdentity.GetCurrent().Name returns the account name that the windows service is using.
Is there any way in which I can accomplish the recolection of this information using perhaps another class or some other way of calling the class?
Thanks in advance, Mario