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
Post a Comment