对于一个项目,我想显示不同的图片和视频。我设法改变了照片。但是我仍然无法显示不同的视频。我尝试对打开VLC-Player的过程进行编程。但是,如果我按该键将终止该过程,则该过程不会关闭
有没有更好的解决方案? 我的代码:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Resources;
using System.Diagnostics;
using System.Runtime.InteropServices;
using System.Threading;
using System.Windows.Input;
namespace keyboardNew
{
public partial class Form1 : Form
{
Process ExternalProcess;
public Form1()
{
InitializeComponent();
}
private void pictureBox1_Click(object sender, EventArgs e)
{
}
private void Form1_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyValue == (char)Keys.A)
{
pictureBox1.Image = Properties.Resources.nase3;
}
else if (e.KeyValue == (char)Keys.S)
{
pictureBox1.Image = Properties.Resources.nasefinal;
}
else if (e.KeyValue == (char)Keys.D) {
pictureBox1.Image = Properties.Resources.seite_a;
ExternalProcess.Kill();
}
else if (e.KeyValue == (char)Keys.Z)
{
ExternalProcess = Process.Start("/filename.mp4");
}
}
}
}