سلام بر تمامی برنامه نویسان #C 😉 در این مطلب کد استفاده از LoadLibrary برای user32.dll در سی شارپ #C را آماده کردم. انشاالله که این کد سی شارپ براتون مفید باشد.
کد استفاده از LoadLibrary برای user32.dll در سی شارپ #C :
using System;
using System.Threading;
using System.Runtime.InteropServices;
using System.Collections.Generic;
using System.Text;
class Program
{
[DllImport("kernel32.dll")]
static extern IntPtr LoadLibrary(string dllName);
[DllImport("kernel32.dll")]
static extern IntPtr GetProcAddress(IntPtr hModule, string procName);
delegate int MessageBoxDelegate(IntPtr hwnd,
[MarshalAs(UnmanagedType.LPWStr)]string text,
[MarshalAs(UnmanagedType.LPWStr)]string caption,
int type);
static void Main(string[] args)
{
using System.Threading;
using System.Runtime.InteropServices;
using System.Collections.Generic;
using System.Text;
class Program
{
[DllImport("kernel32.dll")]
static extern IntPtr LoadLibrary(string dllName);
[DllImport("kernel32.dll")]
static extern IntPtr GetProcAddress(IntPtr hModule, string procName);
delegate int MessageBoxDelegate(IntPtr hwnd,
[MarshalAs(UnmanagedType.LPWStr)]string text,
[MarshalAs(UnmanagedType.LPWStr)]string caption,
int type);
static void Main(string[] args)
{