小编use*_*437的帖子

C#程序错误

这是我的代码:

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);
}
Run Code Online (Sandbox Code Playgroud)

即使我已经包含"使用系统;",我仍然会收到以下错误:

The name 'Console' does not exist in the current context.

有人可以帮我解决这个问题吗?

c# compiler-errors

-2
推荐指数
1
解决办法
133
查看次数

标签 统计

c# ×1

compiler-errors ×1