c# - How to read locked file? -


i'm trying download pdf file generated selectpdf, whe try read newly created file error because file locked , cannot opened.

this code:

htmltopdf converter = new selectpdf.htmltopdf(); selectpdf.pdfdocument doc = converter.converturl("http://myurl.com"); doc.save("mydocument.pdf"); doc.close(); string filename = "mydocument.pdf", mystringwebresource = null; webclient mywebclient = new webclient(); mystringwebresource = filename; mywebclient.downloadfile(mystringwebresource,filename); 

is there way download locked file?

you getting "locked file" error because calling mywebclient.downloadfile("mydocument.pdf","mydocument.pdf");

so trying download local file same local file, hence error.

probably not want that. trying achieve?


Comments

Popular posts from this blog

javascript - Google App Script ContentService downloadAsFile not working -

javascript - Function overwritting -

c# - Exception when attempting to modify Dictionary -