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

Popular posts from this blog

c# - Unity IoC Lifetime per HttpRequest for UserStore -

Change the color of an oval at click in Java AWT -

I am trying to solve the error message 'incompatible ranks 0 and 1 in assignment' in a fortran 95 program. -