home *** CD-ROM | disk | FTP | other *** search
Wrap
;;;;;;;;;; ;; Network Demo - NETTEST.SCT ;; Version 1.0 ;; ;; Copyright 1993 Central Point Software, Inc. ;; ;; Purpose: To demonstrate the network functions in ScriptTools ;; ;; Commands Used: ;; Messagebox( ;; NetAttach( ;; NetConnect( ;; NetDetach( ;; NetDisconnect( ;; Attach ;; Call ;; Define Dialog ;; Dialog ;; Exit ;; If ;; Procedure ;; While ;; ;;;;;;;;;; MessageBox("Net Test","This sample script demonstrates the use of network commands with ScriptTools. If you are not running a Novell network, some functions may not work.",0) Exit1=0 while Exit1<>1 dialog NetFunctionDial Attach1, Connect1, Detach1, Disconnect1, Loaded1, Login1, Logout1, SendMess1, UserName1, Exit1 if Attach1=1 then call net_attach endif if Connect1=1 then call net_connect endif if Detach1=1 then call net_detach endif if Disconnect1=1 then call net_disconnect endif if Loaded1=1 then call net_loaded endif if Login1=1 then call net_login endif if Logout1=1 then call net_logout endif if SendMess1=1 then call net_sendmessage endif if UserName1=1 then call net_username endif endwhile exit Define Dialog NetFunctionDial 240 80 Title "Network Functions" TopLeft 100 200 PushButton 12 8 48 16 "Attach" PushButton 68 8 48 16 "Map Drive" PushButton 12 28 48 16 "Detach" PushButton 68 28 48 16 "Unmap Drive" PushButton 124 48 48 16 "Loaded?" PushButton 124 8 48 16 "Login" PushButton 124 28 48 16 "Logout" PushButton 12 48 48 16 "Send Msg" PushButton 68 48 48 16 "User Name" PushButton 180 28 48 16 "E&xit" EndDef ; ; dialog NetFunctionDial Attach1, MapDrive1, Detach1, UnMapDrv1, Loaded1, Login1, Logout1, SendMsg1, UserName1, Exit1 ; ;Routines for NetAttach ; procedure net_attach dialog NetAttachDial Server$, OK1, Cancel1 if OK1=1 then a=NetAttach(Server$) if a<>1 then Messagebox("Error","Could not attach to server "+Server$,0) endif endif endproc Define Dialog NetAttachDial 165 99 Title "Attach To Network" TopLeft 0 0 Text 16 12 "Server:" EditControl 44 12 96 12 PushButton 28 48 48 16 "OK" Default PushButton 84 48 48 16 "Cancel" EndDef ; ; dialog NetAttachDial Edit1$, OK1, Cancel1 ; ;Routines for NetConnect ; procedure net_connect dialog NetConnectDial Networkpath$, Localname$, Password$, OK1, Cancel1 if OK1=1 then a=Netconnect(Networkpath$,Localname$,Password$) if a<>1 then Messagebox("Error","Could not connect with "+Networkpath$,0) endif endif endproc Define Dialog NetConnectDial 203 112 Title "Connect To Network" TopLeft 0 0 Text 20 16 "Network Path:" Text 24 32 "Local Name:" Text 28 48 "Password:" EditControl 68 16 124 12 EditControl 68 32 60 12 EditControl 68 48 60 12 Password PushButton 40 68 52 16 "OK" Default PushButton 100 68 52 16 "Cancel" EndDef ; ; dialog NetConnectDial Edit1$, Edit2$, Edit3$, OK1, Cancel1 ; ;Routines for NetDetach ; procedure net_detach dialog NetDetachDial Server$, OK1, Cancel1 if OK1=1 then a=NetDetach(Server$) if a<>1 then Messagebox("Error","Could not detach from server "+Server$,0) endif endif endproc Define Dialog NetDetachDial 159 76 Title "Detach from Network" TopLeft 0 0 Text 24 12 "Server:" EditControl 52 12 88 12 PushButton 20 32 52 16 "OK" Default PushButton 80 32 52 16 "Cancel" EndDef ; ; dialog NetDetachDial Edit1$, OK1, Cancel1 ; ;Routines for NetDisconnect ; procedure net_disconnect dialog NetDisconDial Localname$, OK1, Cancel1 if OK1=1 then a=NetDisconnect(Localname$) if a<>1 then Messagebox("Error","Could not disconnect from local name "+Localname$,0) endif endif endproc Define Dialog NetDisconDial 137 76 Title "Disconnect from Network" TopLeft 0 0 Text 12 12 "Local Name:" EditControl 56 12 64 12 PushButton 12 32 52 16 "OK" Default PushButton 68 32 52 16 "Cancel" EndDef ; ; dialog NetDisconDial Edit1$, OK1, Cancel1 ; ;Routines for NetLoaded ; procedure Net_Loaded a=NETLOADED() if a=1 then Messagebox("Net Loaded","Network system is loaded.",0) else Messagebox("Net Loaded","Network system not loaded.",0) endif endproc ;Routines for NetLogin ; Procedure Net_Login dialog NetloginDial Server$, Username$, Password$, OK1, Cancel1 if OK1=1 then a=Netlogin(Username$,Password$,Server$) if a<>1 then Messagebox("Error","Could not log in with username "+Username$,0) endif endif endproc Define Dialog NetLoginDial 150 107 Title "Login To Network" TopLeft 0 0 Text 16 8 "Server:" Text 4 24 "Username:" Text 4 40 "Password:" EditControl 44 8 92 12 EditControl 44 24 92 12 EditControl 44 40 92 12 Password PushButton 12 60 52 16 "OK" Default PushButton 72 60 52 16 "Cancel" EndDef ; ; dialog NetLoginDial Edit1$, Edit2$, Edit3$, OK1, Cancel1 ; ;Routines for NetLogout ; procedure net_logout dialog NetLogoutDial Server$, OK1, Cancel1 if OK1=1 then a=NetLogout(Server$) endif endproc Define Dialog NetLogoutDial 154 68 Title "Log Out From Network" TopLeft 0 0 Text 12 8 "Server:" EditControl 40 8 100 12 PushButton 20 24 52 16 "OK" Default PushButton 80 24 52 16 "Cancel" EndDef ; ; dialog NetLogoutDial Edit1$, OK1, Cancel1 ; ;Routines for NetSendmessage ; Procedure Net_Sendmessage dialog netmessageDial Message$,User$,Server$,OK1,Cancel1 if OK1=1 then a=NetSendMessage(User$,Server$,Message$) if a=1 then messagebox("","Message sent to "+User$,0) else messagebox("","Message not sent to "+User$,0) endif endif endproc Define Dialog NetMessageDial 280 109 Title "Send Message to User on Network" TopLeft 0 0 Text 12 8 "Message:" Text 8 24 "Username:" Text 20 40 "Server:" EditControl 48 8 216 12 EditControl 48 24 80 12 EditControl 48 40 80 12 PushButton 76 60 52 16 "OK" Default PushButton 136 60 52 16 "Cancel" EndDef ; ; dialog NetMessageDial Edit1$, Edit2$, Edit3$, OK1, Cancel1 ; ;Routines for NetUsername ; procedure Net_Username a$=NETUSERNAME$() Messagebox("User Name",a$,0) endproc