傅作义简介,22216轴承,2011sbs歌谣大战节目单
public static void encryptwithpassword(string unencryptedwordpath, string password)
{
word.application wordapp = null;
word.document document = null;
try
{
object missung = system.type.missing;
object odocpath = unencryptedwordpath;
object opassword = password;
wordapp = new word.application();
document = wordapp.documents.open(odocpath);
document.password = password;
document.saveas(ref odocpath, word.wdsaveformat.wdformatdocumentdefault);
}
catch (exception e)
{
string s = e.tostring();
console.writeline(s);
throw;
}
finally
{
quit(wordapp, document);
}
}
public static void quit(word._application wordapp, word._document doc)
{
if(doc != null)
((word._document)doc).close(word.wdsaveoptions.wddonotsavechanges);
object ofalse = false;
//ref false to prevent the word process hang in task manager
if(wordapp !=null && wordapp.application != null)
((word._application)wordapp.application).quit(ref ofalse, ref ofalse, ref ofalse);
}
如对本文有疑问,请在下面进行留言讨论,广大热心网友会与你互动!! 点击进行留言回复
Blazor server side 自家的一些开源的, 实用型项目的进度之 CEF客户端
.NET IoC模式依赖反转(DIP)、控制反转(Ioc)、依赖注入(DI)
vue+.netcore可支持业务代码扩展的开发框架 VOL.Vue 2.0版本发布
网友评论