这是我的代码:
using System.Runtime.InteropServices;
using System;
class Program
{
static void Main(string[] args)
{
int processId;
Console.WriteLine(PlatformInvokeTest.LaunchApp(@"1f0f1577-bc5a-4c10-9a06-f939dc76a130_9tzsbvskx44gy!App", out processId));
Console.WriteLine(processId);
}
}
public class PlatformInvokeTest
{
[DllImport("MAF32.dll")]
public static extern int LaunchApp(
[In, MarshalAs(UnmanagedType.LPWStr)]string processIdentifier,
[Out, MarshalAs(UnmanagedType.U4)] out int processId);
}
即使我包含了“使用系统;”,我仍然收到以下错误:
The name 'Console' does not exist in the current context.
有人可以帮我解决这个问题吗?