- Category: ASP.NET
- #764210Hi Vinod.
Try below piece of code.
FileAttributes obj = File.GetAttributes(path);
File.SetAttributes(path, obj | FileAttributes.ReadOnly);
Refer below msdn article for more information regarding file attributes.
Editor: DNS Forum.
- #764231There is no inbuilt viewer for PDF file exist in ASP.NET, you can open it with its native application.
I mean if user has PDF Acrobat exist and if it open PDF file then bydefault it will open in Acrobat and can be editable, but if user has only Acrobat Reader installed then it can open in view mode.
You just need to use Hyperlink or Linkbutton control to set 'NavigateURL' to PDF file and it will get open
Hope it helps
Editor, DotNetSpider MVM
Microsoft MVP 2014 [ASP.NET/IIS]
- #764386It will be impossible. Cause to view pdf you need pdf viewer embedded in browser. Then when it loads the pdf it also can write or save the file to disk.
If you are unable to do something properly for the first time, call it Version 1.0!
Thanks & Regards,
- #764606To view pdf file in ASP.NET, you can add a pdfviewer control.
refer to this article:
- #764672You'll need a PDF viewer control if you wish to view PDF files in your website. I found these topics which may be helpful: