f



Log on from a program to resources on a server

Hi,

The problem is :
a user start a program on his local computer (XP) and then this
program logs on to the the directory on the server (MS 2008) and work
on the data files (not SQL; the user name and password are set in the
program); the user has no direct access to this data - only the
program; when the program ends, it logs out from the server.

How can I establish a connection to the server's resources; which Win
API functions allow me to log in and log out to the server ?

I need not only the names of the functions (with examples) but also
(first of all) huge amount of knowledge.

Thank you for any help
Regards
Krystian
0
Krystian
9/7/2011 7:08:16 PM
comp.clipper.visual-objects 12618 articles. 0 followers. Post Follow

1 Replies
193 Views

Similar Articles

[PageSpeed] 5

Hi Krystian,

On Wed, 7 Sep 2011 12:08:16 -0700 (PDT), Krystian <softb@softb.pl> wrote:

>Hi,
>
>The problem is :
>a user start a program on his local computer (XP) and then this
>program logs on to the the directory on the server (MS 2008) and work
>on the data files (not SQL; the user name and password are set in the
>program); the user has no direct access to this data - only the
>program; when the program ends, it logs out from the server.
>
>How can I establish a connection to the server's resources; which Win
>API functions allow me to log in and log out to the server ?

You can use WNetAddConnection2(...) windows function to "map" a network
directory to a local drive letter and WNetCancelConnection2(...) to close it at
program exit.

I haven't tried them but they look pretty easy to implement.

HTH,
Amilcar A. Camargo F.
Guatemala, C. A.
http://acf1996.webatu.com/cavo
0
Amilcar
9/10/2011 6:36:25 PM
Reply: