Jump to content
Fivewin Brasil

Como recuperar usuário que está logado na rede?


ram_bh

Recommended Posts


// Using Windows some NetWork DialogBoxes services

#include "FiveWin.ch"

#define TYPE_DRIVE 1
#define TYPE_FILE 2
#define TYPE_PRINTER 3
#define TYPE_COMM 4

//----------------------------------------------------------------------------//

function Main()

local n := 1
local cError

SET _3DLOOK ON

WNetConnect()

? WNetGetUser()

? WNetBrowseDialog( 0,; // hWnd parent of the Dialog
TYPE_PRINTER,; // Try here other TYPE_... values
"e:\" )

? NetName()

? WNetError()

WNetDisconnectDialog()

MsgInfo( NetSerialNumber() )

return nil

//----------------------------------------------------------------------------//


Link to comment
Share on other sites


NetName()

Retrieves the current user name or the computer name.

Syntax

NetName( [<lInfo>] ) --> cComputerName | cUserName

Arguments

<lInfo>

If <lInfo> is set to .T. (true), the function returns the user account name, otherwise it returns the computer name. Return

The function returns a character string containing either the computer name or the user name. If this information cannot be retrieved, an empty string ("") is returned.

Description

NetName() serves informational purposes and is used when different users log into the same computer, or when multiple computers run the same application in a network.

Info

See also: Os(), Version()

Category: Environment functions , Network functions

Source: rtl\net.c

LIB: xhb.lib

DLL: xhbdll.dll

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...