c# - IOException: "A required privilege is not held by the client." best way to overcome? -
i'm writing winform app using c#. while attempting create text file, got error "a required privilege not held client." googled, has user's privileges. put, not allowed create file in chosen path, c:/
tried solution: http://www.technitips.com/2010/06/a-required-privilege-is-not-held-by-the-client-windows-7/, worked once. what's best way overcome kind of error? should change entire window's security setting? or change path somewhere not need admin's permission?
maybe find better folderpath call getfolderpath
environment.getfolderpath(environment.specialfolder.personal));
from msdndoc specialfolder enum
the directory serves common repository documents. member equivalent mydocuments.
if need create temporary file can call:
path.gettempfilename();
which creates uniquely named, zero-byte temporary file on disk , returns full path of file
, see msdn doc
Comments
Post a Comment