现在的位置: 首页 > 综合 > 正文

C# Code Snip

2013年09月15日 ⁄ 综合 ⁄ 共 455字 ⁄ 字号 评论关闭

1.design with the delegates.Use the ?? operator everywhere to simplify a bit

example:

if (jump == null)

{

    Run();

else

{

   jump();

 

should be:

(jump ?? Run)();

or

(jump ?? Run).Invoke(); 



2. 版本

Application.ProductVersion


3. Html to word

var varWord = new Microsoft.Office.Interop.Word.Application();
   varWord.Visible = false;
Object o = Type.Missing;
object docFile = @"D:\Test.mht";
var varDoc = varWord.Documents.Open(ref docFile,ref o, true);
varDoc.SaveAs2(@"d:\test1.doc");
object t = true;
varWord.Quit(true);

抱歉!评论已关闭.