home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Beijing Paradise BBS Backup
/
PARADISE.ISO
/
software
/
BBSDOORW
/
NETCLB35.ZIP
/
NETCLB35.EXE
/
EXAMPLES
/
GETNWSN.C
< prev
next >
Wrap
C/C++ Source or Header
|
1996-01-03
|
2KB
|
58 lines
/***************************************************************************/
/* File: GETNWSN.C */
/* */
/* Function: Output the current servers serial and application */
/* numbers. */
/* */
/* Usage: getnwsn */
/* */
/* Functions Called: GetNetworkSerialNumber */
/* GetPreferredConnectionID */
/* GetDefaultConnectionID */
/* GetPrimaryConnectionID */
/* SetPreferredConnectionID */
/* ISShellLoaded */
/* */
/***************************************************************************/
#include "netware.h"
#include <stdio.h>
void main(void)
{
dword serialnumber;
word appnumber;
int rcode;
int thisserver,prefserver;
if (IsShellLoaded() != SUCCESS)
{
printf("*** No netware shell loaded ***\n");
return;
}
if ((prefserver = GetPreferredConnectionID()) == 0)
{
if ((thisserver = GetDefaultConnectionID()) == 0)
thisserver = GetPrimaryConnectionID();
SetPreferredConnectionID( thisserver );
}
else
thisserver = prefserver;
rcode=GetNetworkSerialNumber( &serialnumber,&appnumber );
if (rcode != 0)
printf("GetNetworkSerialNumber failed:%d\n",rcode);
else
{
printf("\nServer Serial Number: 0x%08.8lx\n",serialnumber);
printf( " Application Number: 0x%04.4x\n\n",appnumber);
}
if (thisserver != prefserver) /* reset preferred server */
SetPreferredConnectionID( prefserver );
return;
}