#include À» ÀÎŬ·çµå ÇϽðí¿ä ... #define MESGLEN 50 PSERVER_INFO_503 GetServerInfo(void); // gets & displays this systems // name ºÒ·¯¿Ã ÇÔ¼ö ºÎºÐ¿¡¼­ ¾Æ·¡°Å ¼±¾ðÇϽñ¸¿ä. NET_API_STATUS nasRc; // return code from NetXxxx() PSERVER_INFO_503 si503; // Server info structure LPWSTR awcFromName; // default machine name for NetMsgBufrSend() si503 = GetServerInfo(); sprintf(_T("You are logged into domain: %s.\n"), si503->sv503_domain); ÇÏ½Ã¸é ³Ñ¾î¿Ã°Å¿¹¿ä /* ************************************************************************** * PROCEDURE: PSERVER_INFO_503 GetServerInfo(void) * PURPOSE: Get the name of this server * CALL: GetServerInfo() * RETURNS: SERVER_INFO_503* * MODIFY: Nothing * *********************************************************************** */ PSERVER_INFO_503 GetServerInfo(void) { NET_API_STATUS nasRc; // return code from NetXxxx() LPBYTE buff; nasRc = NetServerGetInfo(NULL,503,&buff); if(nasRc != NERR_Success) { switch(nasRc) { case ERROR_ACCESS_DENIED: // The user does not have access to // the requested information. break; case ERROR_INVALID_LEVEL: // The value specified for the Level parameter is invalid. case ERROR_INVALID_PARAMETER: // The specified parameter is invalid. break; case ERROR_NOT_ENOUGH_MEMORY: // Insufficient memory is available. break; } exit(2); } return((PSERVER_INFO_503) buff); } ÀÌ°Ô Á¦°¡ ¾Ë¾Æ³½ ÀüºÎ ÀÔ´Ï´Ù. µµ¿òÀÌ µÇ¼ÌÀ¸¸é Çϳ׿ä ...