Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Connect to Windows NT from Visual FoxPro
Message
From
02/06/1997 15:56:43
 
 
To
02/06/1997 14:59:11
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Miscellaneous
Thread ID:
00034577
Message ID:
00034587
Views:
48
>Can someone give me a sample of WNetAddConnection2() and what is related in order to establish a login on a Windows NT from Visual FoxPro?

After having compiled a lot of stuff here and there, I came with this program to try to login to the server. However, when I try to run this, I get too many arguments. Any idea? Thanks.

DECLARE INTEGER WNetAddConnection2 IN Win32API AS AddNetConnect;
@STRING, @STRING, @STRING, INTEGER

#define RESOURCE_CONNECTED chr(1)+chr(0)+chr(0)+chr(0)
#define RESOURCE_GLOBALNET chr(2)+chr(0)+chr(0)+chr(0)
#define RESOURCE_REMEMBERED chr(3)+chr(0)+chr(0)+chr(0)

#define RESOURCETYPE_ANY chr(0)+chr(0)+chr(0)+chr(0)
#define RESOURCETYPE_DISK chr(1)+chr(0)+chr(0)+chr(0)
#define RESOURCETYPE_PRINT chr(2)+chr(0)+chr(0)+chr(0)

#define RESOURCEDISPLAYTYPE_GENERIC chr(0)+chr(0)+chr(0)+chr(0)
#define RESOURCEDISPLAYTYPE_DOMAIN chr(1)+chr(0)+chr(0)+chr(0)
#define RESOURCEDISPLAYTYPE_SERVER chr(2)+chr(0)+chr(0)+chr(0)
#define RESOURCEDISPLAYTYPE_SHARE chr(3)+chr(0)+chr(0)+chr(0)

#define RESOURCEUSAGE_CONNECTABLE chr(1)+chr(0)+chr(0)+chr(0)
#define RESOURCEUSAGE_CONTAINER chr(2)+chr(0)+chr(0)+chr(0)

lstNetResource=RESOURCE_GLOBALNET+RESOURCETYPE_DISK+RESOURCEDISPLAYTYPE_GENERIC+;
RESOURCEUSAGE_CONNECTABLE+"h:"+chr(0)+"\\d4682101\d$"+chr(0)+chr(0)+chr(0)

lcPassword='password'
lcUser='username'

? AddNetConnect(@lstNetResource,@lcPassword,@lcUser,0)
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform