Visual Studio Code:找不到类型或命名空间名称“IntPtr”

use*_*199 0 c# visual-studio-code

如何获取用户“Brian”在如何在 C#/Win32 中将文本发送到记事本中提交的代码?在 Visual Studio Code 中工作。

我做了一个“Dotnet add package System.Runtime”,似乎添加了 System.Runtime 包,但我仍然收到编译错误: WriteNotepad.cs(10,50): error CS0246: The type or namespace name 'IntPtr ' 无法找到(您是否缺少 using 指令或程序集引用?)

斯蒂芬

小智 5

IntPtr is in the System namespace so include this up top.

using System;