尝试让我的游戏启动器使用以下代码打开外部可执行文件时,我一直收到NotImplementedException错误:
using System;
using System.ComponentModel;
using System.Collections.Generic;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.IO;
using System.IO.Compression;
using System.Diagnostics;
using System.Net;
namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
Process.Start("C:/Users/Me/AppData/Local/osu!");
}
private void openFileDialog1_FileOk(object sender, CancelEventArgs e)
{
}
private void folderBrowserDialog1_HelpRequest(object sender, EventArgs e)
{
}
private void webBrowser1_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e)
{
}
private void Form1_Load(object sender, EventArgs e)
{
}
private void button2_Click(object sender, EventArgs e)
{
Environment.Exit(0);
}
}
internal class CustomWindow
{
private string v;
public CustomWindow(string v)
{
this.v = v;
}
internal void Show()
{
throw new NotImplementedException();
}
}
internal class Window1 : Form
{
}
internal class Process
{
public object StartInfo { get; internal set; }
internal static void Start(string v)
{
throw new NotImplementedException();
}
}
}
注意:我刚开始学习C#,所以请耐心等待我。
答案 0 :(得分:0)
如果您想要启动外部应用,请考虑以下内容,
谢谢,
答案 1 :(得分:0)
internal static void Start(string v)
{
throw new NotImplementedException();
}
你有故意抛出NotImplementedException的代码。 C#已经具有此功能,您无需为其创建类。删除你的并使用它:https://msdn.microsoft.com/en-us/library/system.diagnostics.process.start(v=vs.110).aspx
除非您打算对其进行特殊处理,否则只需删除您的流程类。