gameover.blog.ir
رفع خطای The type or namespace name 'DllImport' could not be found (are you missing a using directive or an assembly reference در سیشارپ.
دستور زیر رو در نظر بگیرید:
public partial class MainForm : Form
{
[DllImport("user32.dll", SetLastError = true)]
private static exte IntPtr FindWindow(string lpClassName, string lpWindowName);
public MainForm()
بعد اجرا خطای زیر دریافت میشه:
The type or namespace name 'DllImport' could not be found (are you missing a using directive or an assembly reference?) (CS0246)
using System.Runtime.InteropServices;
برچسب:
نویسنده: ایلیا حیدری