Office中国论坛/Access中国论坛

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

作者: ppdd    时间: 2014-3-2 09:53
标题: 【作业】01课-ppdd
本帖最后由 faunus 于 2014-3-7 21:59 编辑

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Office.Tools.Ribbon;
using System.Diagnostics;

namespace PowerPointAddIntest1
{
    public partial class Ribbon1
    {
        private void Ribbon1_Load(object sender, RibbonUIEventArgs e)
        {

        }

        private void button1_Click(object sender, RibbonControlEventArgs e)
        {
           //方法1
            // System.Diagnostics.Process.Start("notepad.exe");  显式启动记事本;

            //方法2
              System.Diagnostics.Process Proc;
                // 启动记事本
                Proc = new System.Diagnostics.Process();
                Proc.StartInfo.FileName = "notepad.exe";
                Proc.StartInfo.UseShellExecute = false;
                Proc.StartInfo.RedirectStandardInput = true;
                Proc.StartInfo.RedirectStandardOutput = true;

                Proc.Start();


        }

        private void button2_Click(object sender, RibbonControlEventArgs e)
        {
            if (chk_yy.Checked)
            {
                System.Diagnostics.Process.Start("yy://pd-[sid=91283328&subid=769333290]");
            }
            else
            {
                System.Diagnostics.Process.Start("http://yy.com/91283328/91283328?from=769333290");
            }
        }
    }
}
C#从无知到能做这一点小程序,很高兴。
[attach]53282[/attach]

[attach]53283[/attach][attach]53284[/attach]



作者: tmtony    时间: 2014-3-2 12:48
第一个作业 ,先顶一个
作者: yjjcm    时间: 2014-3-2 16:50
方法一个方法二都符合老师讲的隐藏记事本吗?
作者: 紫电    时间: 2014-3-7 23:29
[attach]53401[/attach]
没能后台打开记事本





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