Board index » delphi » WNetAddConnection2

WNetAddConnection2

Anyone know how to properly call WNetAddConnection2? I am trying to
connect to a network resource from a 95 machine to an NT machine using a
different user name. I think that Windows isn't taking the passed User
Name or Password. (It's trying to connect to the resource using the
*current* user name and password.) Under NT's standard net connection
dialog box, you can specify a 'Connect As' parameter, but 95 doesn't
have it.

 

Re:WNetAddConnection2


You're right Win 95 passes the current usename but the password you specify
in the WNetAddConnection2() function.  Because Win 95 (apparently) can't
access the current user's password, the WNetAddConnection2() function
requires you to enter it.

What I require my end users to do (if they want to access my NT server) is
to log on with the username I supply - locally, they can define their own
password.  When I use WNetAddConnection2() I use a different password
(which I don't disclose to the end user).  This username (secret) password
combination gives access to the NT server resources I've allocated.

This means they gain access only through my code.

HTH,

--
Paul Motyer
paulm at pccity.com.au - now working!
Soft Stuff, Croydon, Australia, 3136

Tom Goulding <t...@chipsnsalsa.com> wrote in article
<33678F24.45A6F...@chipsnsalsa.com>...

Quote
> Anyone know how to properly call WNetAddConnection2? I am trying to
> connect to a network resource from a 95 machine to an NT machine using a
> different user name. I think that Windows isn't taking the passed User
> Name or Password. (It's trying to connect to the resource using the
> *current* user name and password.) Under NT's standard net connection
> dialog box, you can specify a 'Connect As' parameter, but 95 doesn't
> have it.

Other Threads