|
我上交作业了
- public Process myPro = new Process(); //新建一个进程
- private void button1_Click(object sender, RibbonControlEventArgs e)
- {
-
- // string tmp = "";
- // 添加 Microsoft.VisualBasic 的引用
- // 引用VB的inputBox
- string tmp = Microsoft.VisualBasic.Interaction.InputBox("请输入频道号", "对话框标题", "91283328");
- if (ckbYY.Checked == true)
- {
- try
- {
- System.Windows.Forms.MessageBox.Show("进入YY软件");
- System.Diagnostics.Process.Start("yy://pd-[sid=" + tmp + "&subid=2175343697]");
- }
- catch (Exception)
- {
- System.Windows.Forms.MessageBox.Show("网页版的YY");
- System.Diagnostics.Process.Start("http://yy.com/" + tmp + "/2175343697?from="); //网页版的YY
- }
- ;
- }
- else {
- System.Windows.Forms.MessageBox.Show("网页版的YY");
- System.Diagnostics.Process.Start("http://yy.com/" + tmp + "/2175343697?from="); //网页版的YY
- }
-
-
- }
- private void btnNoteP_Click(object sender, RibbonControlEventArgs e)
- {
-
- System.Windows.Forms.MessageBox.Show("进入记事本");
- myPro.StartInfo.FileName = "notepad.exe";//打开记事本
- myPro.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;//隐藏运行
-
- myPro.Start();
-
- }
复制代码 |
评分
-
查看全部评分
|