Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Network machine name in Win95 with Novell?
Message
From
02/09/1997 16:37:45
 
General information
Forum:
Visual FoxPro
Category:
Client/server
Miscellaneous
Thread ID:
00048101
Message ID:
00048110
Views:
23
>I've been told here in my new job with VFP that the previous programmer discovered that he could not access the "machine name" in Win95 as he had been doing in Win 3.1.
>This is all new territory for me, but I have to learn how to set up access levels for about 80 people, so if anyone is knowledgeable about what is possible on the network with Win95, I would appreciate some clues....
>Thank you, Tom Hayward

Tom,
The following code returns the user id from my novell 4.1 network.... Got it off the newsgroups a while back:

* Program : GetNetId
* Author : Public Domain from MS Newsgroups
* Purpose : Returns user ID from Novell Network (3/4)
* Known Limitations : Works only in VFP 5
* Return Value : Char, Id # or Spaces

LOCAL ;
lcNull, ;
lcUserId, ;
lnLen

lcNull=""
lcUserId=SPACE(255)
lnLen=255

IF _WINDOWS AND ( "NT" $ OS() OR "WINDOWS 4." $ UPPER(OS()) )

* Use the WNetGetUser function in the Win32API to get the user id
DECLARE INTEGER WNetGetUser IN WIN32API String @, String @, Integer @

IF WNetGetUser(@lcNull,@lcUserId,@lnLen)=0

lcUserId=UPPER(LEFT(lcUserId,AT(CHR(0),lcUserId)-1))

ELSE

lcUserId = ""

ENDIF

ENDIF

RETURN ALLTRIM(lcUserId)

Enjoy!!

Tony Miller
PTI
Previous
Reply
Map
View

Click here to load this message in the networking platform