Office中国论坛/Access中国论坛

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

作者: 小影    时间: 2014-3-7 23:07
标题: 【作业】01课-小影
本帖最后由 小影 于 2014-3-7 23:16 编辑
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using Microsoft.Office.Tools.Ribbon;
  6. using System.Diagnostics;
  7. using System.Windows.Forms;

  8. namespace PowerPointAddIn1
  9. {
  10.     public partial class Ribbon1
  11.     {
  12.         private void Ribbon1_Load(object sender, RibbonUIEventArgs e)
  13.         {

  14.         }

  15.         private void button1_Click(object sender, RibbonControlEventArgs e)
  16.         {
  17.             Process pro = new Process();
  18.             ProcessStartInfo proStartInfo = new ProcessStartInfo("notepad.exe");
  19.             proStartInfo.WindowStyle = ProcessWindowStyle.Hidden;
  20.             pro.StartInfo = proStartInfo;
  21.             pro.Start();
  22.            
  23.         }

  24.         private void buttonOpenYY_Click(object sender, RibbonControlEventArgs e)
  25.         {
  26.             if (!checkBoxOpenYY.Checked)
  27.             {
  28.                 //在这里打开软件YY
  29.                 try
  30.                 {
  31.                     Process.Start("yy://pd-[sid=91283328&subid=2175343697]");
  32.                 }
  33.                 catch (Exception ex)
  34.                 {
  35.                     MessageBox.Show("亲,你没有安装YY,请下载安装");
  36.                     throw;
  37.                 }
  38.             }
  39.             else
  40.             {
  41.                 //在这里打开网页YY
  42.                 try
  43.                 {
  44.                     Process.Start("http://yy.com/91283328/2175343697?from=");
  45.                 }
  46.                 catch (Exception ex)
  47.                 {
  48.                     MessageBox.Show("打开错误!");
  49.                     throw;
  50.                 }
  51.             }
  52.         }
  53.     }
  54. }
复制代码
我有个好同桌。。。
各位节日快乐,辛苦了。。。

作者: 紫电    时间: 2014-3-7 23:37
本帖最后由 紫电 于 2014-3-7 23:57 编辑

[attach]53412[/attach]





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