ram_bh Posted February 19, 2015 Report Share Posted February 19, 2015 Bom dia! Alguém pode informar como recuperar o usuário que está logado na rede (windows server 2008)? A idéia é recuperar o usuário logado e autenticar na aplicação. Obrigado! Rodrigo Melo Belo Horizonte Mashafire 1 Quote Link to comment Share on other sites More sharing options...
kapiaba Posted February 19, 2015 Report Share Posted February 19, 2015 // 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 //----------------------------------------------------------------------------// Quote Link to comment Share on other sites More sharing options...
sambomb Posted February 19, 2015 Report Share Posted February 19, 2015 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 Quote Link to comment Share on other sites More sharing options...
ram_bh Posted February 19, 2015 Author Report Share Posted February 19, 2015 Kapiaba, muito obrigado! Quote Link to comment Share on other sites More sharing options...
ram_bh Posted February 19, 2015 Author Report Share Posted February 19, 2015 Obrigado, RCA Sistemas! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.