home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
DP Tool Club 3
/
CDASC03.ISO
/
sorties
/
4140
/
whois_.exe
/
WHOIS.CPP
< prev
next >
Wrap
Text File
|
1991-11-26
|
2KB
|
71 lines
//#include <stdio.h>
#include <iostream.h>
#include <conio.h>
#include <string.h>
#include "sllist.hpp"
extern "C"
{
#include <niterror.h>
#include <nit.h>
char *get_full_name(char *object_name);
}
/*========================================================*/
main(int argc, char *argv[])
{
char instring[48], *inptr;
long objectID = -1;
char objectName[48];
WORD objectType;
char objectHasProps;
char objectFlag;
char objectSecurity;
char *ptr, *ptr2;
char name_fullname[80];
sllist UserList;
strcpy(instring, argv[1]);
instring[47]='\0';
inptr=strupr(instring);
while(!ScanBinderyObject("*", OT_USER, &objectID, objectName,
&objectType, &objectHasProps, &objectFlag, &objectSecurity))
{
ptr2=get_full_name(objectName);
ptr=strupr(ptr2);
strcpy(name_fullname, objectName);
strcat(name_fullname, " ==> ");
strcat(name_fullname, ptr);
UserList.add_queue(name_fullname);
}
node *temp = UserList.get_head();
while(temp)
{
if(strstr(temp->file_name, inptr))
{
cout << temp->file_name << endl;
}
temp=(node *) temp->next;
}
}
/*========================================================*/
char *get_full_name(char *object_name)
{
WORD objType = OT_USER;
BYTE moreSegs = 0, propFlags=0, full_name[128];
int ccode = 0;
strcpy((char *) full_name, "");
ccode = ReadPropertyValue(object_name, objType, "IDENTIFICATION", 1, full_name,
&moreSegs, &propFlags);
if(ccode)
strcpy((char *) full_name, "");
return((char *) full_name);
}
/*========================================================*/