Office中国论坛/Access中国论坛

标题: 【作业】01课-徐冬 [打印本页]

作者: josonxu    时间: 2014-3-8 10:35
标题: 【作业】01课-徐冬
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using Microsoft.Office.Tools.Ribbon;

  6. namespace WordAddIn1
  7. {
  8.     public partial class Ribbon1
  9.     {
  10.         private void Ribbon1_Load(object sender, RibbonUIEventArgs e)
  11.         {
  12.         }

  13.         private void button1_Click(object sender, RibbonControlEventArgs e)
  14.         {
  15.             System.Diagnostics.Process myProcess = new System.Diagnostics.Process();
  16.             System.Diagnostics.ProcessStartInfo myProStartInfo = new System.Diagnostics.ProcessStartInfo("notepad.exe");
  17.             myProcess.StartInfo = myProStartInfo;
  18.             myProcess.StartInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden;
  19.             myProcess.Start();
  20.         }

  21.         private void button2_Click(object sender, RibbonControlEventArgs e)
  22.         {
  23.             if (this.checkBox1.Checked)//如果勾选
  24.             {
  25.                 System.Diagnostics.Process.Start("http://yy.com/91283328/2175343697?from=");//打开网页YY
  26.             }
  27.             else
  28.             {
  29.                 System.Diagnostics.Process.Start("yy://pd-[sid=91283328&subid=2175343697]");//打开软件YY
  30.             }
  31.         }
  32.     }
  33. }
复制代码

作者: 紫电    时间: 2014-3-10 11:55






欢迎光临 Office中国论坛/Access中国论坛 (http://www.office-cn.net/) Powered by Discuz! X3.3