xHarbour Reference Documentation > Function Reference xHarbour Developers Network  

NetRedir()

Establishes a connection to a server.

Syntax

NetRedir( <cLocal>    , ;
          <cServer>   , ;
         [<cPassword>], ;
         [<lShowError>] ) --> lSuccess

Arguments

<cLocal>
This is a character string holding the name of the local device to redirect to a server (e.g. "K:").
<cServer>
This is a character string holding the name of the remote device to connect to (e.g. "\\SERVER05\MARKETING").
<cPassword>
Optionally, a character string holding the password for the server connection can be specified.
<lShowError>
This parameter defaults to .F. (false). When .T. (true) is passed, the function generates a runtime error if the connection fails.

Return

The function returns .T. (true) if the connection to the server is successfully established, otherwise .F. (false) is returned.

Info

See also:NetCancel(), NetRmtName()
Category: CT:Network , Network functions
Source:ct\ctnet.c
LIB:xhb.lib
DLL:xhbdll.dll

Example

// The example connects the local drive "K:" to a server

   PROCEDURE Main
     // no error handling
     ? NetRedir( "Z:", "\\SERVER01\DEVELOPER" )

     // runtime error if connection fails
     ? NetRedir( "Z:", "\\SERVER01\DEVELOPER", "Password" , .T. )
   RETURN

Copyright © 2006-2007 xHarbour.com Inc. All rights reserved.
http://www.xHarbour.com
Created by docmaker.exe