سلام بر تمامی برنامه نویسان #C 😉 در این پست کد گرفتن نام کامپیوتر با استفاده از kernel32.dll در #C را آماده کردم. انشاالله که این کد سی شارپ براتون مفید باشد.
خروجی این کد به این صورت است:
JAVA2S
کد گرفتن نام کامپیوتر با kernel32.dll در #C :
using System;
using System.Runtime.InteropServices;
class MainClass
{
[ DllImport( "kernel32.dll" ) ]
static extern unsafe bool GetComputerNameW( char* name, ref ulong size );
[STAThread]
static unsafe void Main(string[] args)
{
ulong size = 256;
using System.Runtime.InteropServices;
class MainClass
{
[ DllImport( "kernel32.dll" ) ]
static extern unsafe bool GetComputerNameW( char* name, ref ulong size );
[STAThread]
static unsafe void Main(string[] args)
{
ulong size = 256;