日期:2014-05-17 浏览次数:20911 次
using Word = Microsoft.Office.Interop.Word; var app = new Word.Application(); var doc = app.Documents.Open("d:/test.docx"); app.ActiveDocument.Protect(Word.WdProtectionType.wdAllowOnlyReading, Password: "xxxx");
System.IO.FileInfo fi = new System.IO.FileInfo("c:/d.doc"); fi.Attributes = System.IO.FileAttributes.ReadOnly;