Access Denied Error when attempting to Zip A file after creating it
hello: have code create folder append date , time , zip folder. code: namespace filecreation { class program { static void main(string[] args) { string foldername = @"c:\test"; string subfoldername = "sample_" + datetime.now.tostring("yyyy_mm_dd.hh.mm.dd"); string pathstring = system.io.path.combine(foldername, subfoldername); system.io.directory.createdirectory(pathstring); zipfile.createfromdirectory(subfoldername, foldername); } } } following error eventhoug admin on computer. referencing resources on page: http://msdn.microsoft.com/en-us/library/hh485721%28v=vs.110%29.aspx an unhandled exception of type 'system.unauthorizedaccessexception' occurred in system.io.compression.filesystem.dll additional information: access path 'c:\test' denied. not sure why access denied. feedback. zipfile.cre...