c# - how to encrypt a file While downloading -
i having problem encrypt file while downloading.i using code download database excel file
gridview gv = new gridview(); gv.datasource = graphids.tolist(); gv.databind(); response.clearcontent(); response.buffer = true; response.addheader("content-disposition", "attachment; filename=graphtable.xls"); response.contenttype = "application/ms-excel"; response.charset = ""; stringwriter sw = new stringwriter(); htmltextwriter htw = new htmltextwriter(sw); response.output.write(sw.tostring()); response.flush(); response.end();
now after code file automatically downloaded download folder of pc , want encrypt xls file before downloading?
use system.security
filestream fsinput = new filestream(sinputfilename, filemode.open, fileaccess.read); filestream fsencrypted = new filestream(soutputfilename, filemode.create, fileaccess.write);
Comments
Post a Comment