home *** CD-ROM | disk | FTP | other *** search
/ Software Collection (I) / TOOLS.iso / f06 / 0528-2.img / NETTEST.SC_ / NETTEST.SC
Encoding:
Text File  |  1993-03-12  |  6.2 KB  |  294 lines

  1. ;;;;;;;;;;
  2. ;;    Network Demo - NETTEST.SCT
  3. ;;    Version 1.0
  4. ;;
  5. ;;    Copyright 1993 Central Point Software, Inc.
  6. ;;
  7. ;;    Purpose:    To demonstrate the network functions in ScriptTools
  8. ;;
  9. ;;    Commands Used:
  10. ;;        Messagebox(
  11. ;;        NetAttach(
  12. ;;        NetConnect(
  13. ;;        NetDetach(
  14. ;;        NetDisconnect(
  15. ;;        Attach
  16. ;;        Call
  17. ;;        Define Dialog
  18. ;;        Dialog
  19. ;;        Exit
  20. ;;        If
  21. ;;        Procedure
  22. ;;        While
  23. ;;
  24. ;;;;;;;;;;
  25.     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)
  26.     Exit1=0
  27.     while Exit1<>1
  28.         dialog NetFunctionDial Attach1, Connect1, Detach1, Disconnect1, Loaded1, Login1, Logout1, SendMess1, UserName1, Exit1
  29.         if Attach1=1 then call net_attach endif
  30.         if Connect1=1 then call net_connect endif
  31.         if Detach1=1 then call net_detach endif
  32.         if Disconnect1=1 then call net_disconnect endif
  33.         if Loaded1=1 then call net_loaded endif
  34.         if Login1=1 then call net_login endif
  35.         if Logout1=1 then call net_logout endif
  36.         if SendMess1=1 then call net_sendmessage endif
  37.         if UserName1=1 then call net_username endif
  38.     endwhile
  39.  
  40. exit
  41.  
  42. Define Dialog NetFunctionDial 240 80
  43.     Title "Network Functions"
  44.     TopLeft 100 200
  45.     PushButton 12 8 48 16 "Attach"
  46.     PushButton 68 8 48 16 "Map Drive"
  47.     PushButton 12 28 48 16 "Detach"
  48.     PushButton 68 28 48 16 "Unmap Drive"
  49.     PushButton 124 48 48 16 "Loaded?"
  50.     PushButton 124 8 48 16 "Login"
  51.     PushButton 124 28 48 16 "Logout"
  52.     PushButton 12 48 48 16 "Send Msg"
  53.     PushButton 68 48 48 16 "User Name"
  54.     PushButton 180 28 48 16 "E&xit"
  55. EndDef
  56.  
  57. ;
  58. ; dialog NetFunctionDial Attach1, MapDrive1, Detach1, UnMapDrv1, Loaded1, Login1, Logout1, SendMsg1, UserName1, Exit1
  59. ;
  60.  
  61.  
  62.  
  63.  
  64. ;Routines for NetAttach
  65. ;
  66. procedure net_attach
  67.     dialog NetAttachDial Server$, OK1, Cancel1
  68.     if OK1=1 then
  69.         a=NetAttach(Server$)
  70.         if a<>1 then
  71.             Messagebox("Error","Could not attach to server "+Server$,0)
  72.         endif
  73.     endif
  74. endproc
  75.  
  76. Define Dialog NetAttachDial 165 99
  77.     Title "Attach To Network"
  78.     TopLeft 0 0
  79.     Text 16 12 "Server:"
  80.     EditControl 44 12 96 12
  81.     PushButton 28 48 48 16 "OK" Default
  82.     PushButton 84 48 48 16 "Cancel"
  83. EndDef
  84.  
  85. ;
  86. ; dialog NetAttachDial Edit1$, OK1, Cancel1
  87. ;
  88.  
  89.  
  90.  
  91. ;Routines for NetConnect
  92. ;
  93. procedure net_connect
  94.     dialog NetConnectDial Networkpath$, Localname$, Password$, OK1, Cancel1
  95.     if OK1=1 then
  96.         a=Netconnect(Networkpath$,Localname$,Password$)
  97.         if a<>1 then
  98.             Messagebox("Error","Could not connect with "+Networkpath$,0)
  99.         endif
  100.     endif
  101. endproc
  102.  
  103. Define Dialog NetConnectDial 203 112
  104.     Title "Connect To Network"
  105.     TopLeft 0 0
  106.     Text 20 16 "Network Path:"
  107.     Text 24 32 "Local Name:"
  108.     Text 28 48 "Password:"
  109.     EditControl 68 16 124 12
  110.     EditControl 68 32 60 12
  111.     EditControl 68 48 60 12 Password
  112.     PushButton 40 68 52 16 "OK" Default
  113.     PushButton 100 68 52 16 "Cancel"
  114. EndDef
  115.  
  116. ;
  117. ; dialog NetConnectDial Edit1$, Edit2$, Edit3$, OK1, Cancel1
  118. ;
  119.  
  120.  
  121.  
  122.  
  123. ;Routines for NetDetach
  124. ;
  125. procedure net_detach
  126.     dialog NetDetachDial Server$, OK1, Cancel1
  127.     if OK1=1 then
  128.         a=NetDetach(Server$)
  129.         if a<>1 then
  130.             Messagebox("Error","Could not detach from server "+Server$,0)
  131.         endif
  132.     endif
  133. endproc
  134.  
  135. Define Dialog NetDetachDial 159 76
  136.     Title "Detach from Network"
  137.     TopLeft 0 0
  138.     Text 24 12 "Server:"
  139.     EditControl 52 12 88 12
  140.     PushButton 20 32 52 16 "OK" Default
  141.     PushButton 80 32 52 16 "Cancel"
  142. EndDef
  143.  
  144. ;
  145. ; dialog NetDetachDial Edit1$, OK1, Cancel1
  146. ;
  147.  
  148.  
  149.  
  150.  
  151.  
  152. ;Routines for NetDisconnect
  153. ;
  154. procedure net_disconnect
  155.     dialog NetDisconDial Localname$, OK1, Cancel1
  156.     if OK1=1 then
  157.         a=NetDisconnect(Localname$)
  158.         if a<>1 then
  159.             Messagebox("Error","Could not disconnect from local name "+Localname$,0)
  160.         endif
  161.     endif
  162. endproc
  163.  
  164. Define Dialog NetDisconDial 137 76
  165.     Title "Disconnect from Network"
  166.     TopLeft 0 0
  167.     Text 12 12 "Local Name:"
  168.     EditControl 56 12 64 12
  169.     PushButton 12 32 52 16 "OK" Default
  170.     PushButton 68 32 52 16 "Cancel"
  171. EndDef
  172.  
  173. ;
  174. ; dialog NetDisconDial Edit1$, OK1, Cancel1
  175. ;
  176.  
  177.  
  178.  
  179.  
  180. ;Routines for NetLoaded
  181. ;
  182. procedure Net_Loaded
  183.     a=NETLOADED()
  184.     if a=1 then
  185.         Messagebox("Net Loaded","Network system is loaded.",0)
  186.     else
  187.         Messagebox("Net Loaded","Network system not loaded.",0)
  188.     endif
  189. endproc
  190.  
  191.  
  192.  
  193.  
  194. ;Routines for NetLogin
  195. ;
  196. Procedure Net_Login
  197.     dialog NetloginDial Server$, Username$, Password$, OK1, Cancel1
  198.     if OK1=1 then
  199.         a=Netlogin(Username$,Password$,Server$)
  200.         if a<>1 then
  201.             Messagebox("Error","Could not log in with username "+Username$,0)
  202.         endif
  203.     endif
  204. endproc
  205.  
  206. Define Dialog NetLoginDial 150 107
  207.     Title "Login To Network"
  208.     TopLeft 0 0
  209.     Text 16 8 "Server:"
  210.     Text 4 24 "Username:"
  211.     Text 4 40 "Password:"
  212.     EditControl 44 8 92 12
  213.     EditControl 44 24 92 12
  214.     EditControl 44 40 92 12 Password
  215.     PushButton 12 60 52 16 "OK" Default
  216.     PushButton 72 60 52 16 "Cancel"
  217. EndDef
  218.  
  219. ;
  220. ; dialog NetLoginDial Edit1$, Edit2$, Edit3$, OK1, Cancel1
  221. ;
  222.  
  223.  
  224.  
  225.  
  226.  
  227. ;Routines for NetLogout
  228. ;
  229. procedure net_logout
  230.     dialog NetLogoutDial Server$, OK1, Cancel1
  231.     if OK1=1 then
  232.         a=NetLogout(Server$)
  233.     endif
  234. endproc
  235.  
  236. Define Dialog NetLogoutDial 154 68
  237.     Title "Log Out From Network"
  238.     TopLeft 0 0
  239.     Text 12 8 "Server:"
  240.     EditControl 40 8 100 12
  241.     PushButton 20 24 52 16 "OK" Default
  242.     PushButton 80 24 52 16 "Cancel"
  243. EndDef
  244.  
  245. ;
  246. ; dialog NetLogoutDial Edit1$, OK1, Cancel1
  247. ;
  248.  
  249.  
  250.  
  251.  
  252. ;Routines for NetSendmessage
  253. ;
  254. Procedure Net_Sendmessage
  255.     dialog netmessageDial Message$,User$,Server$,OK1,Cancel1
  256.     if OK1=1 then
  257.         a=NetSendMessage(User$,Server$,Message$)
  258.         if a=1 then
  259.             messagebox("","Message sent to "+User$,0)
  260.         else
  261.             messagebox("","Message not sent to "+User$,0)
  262.         endif
  263.     endif
  264. endproc
  265.  
  266. Define Dialog NetMessageDial 280 109
  267.     Title "Send Message to User on Network"
  268.     TopLeft 0 0
  269.     Text 12 8 "Message:"
  270.     Text 8 24 "Username:"
  271.     Text 20 40 "Server:"
  272.     EditControl 48 8 216 12
  273.     EditControl 48 24 80 12
  274.     EditControl 48 40 80 12
  275.     PushButton 76 60 52 16 "OK" Default
  276.     PushButton 136 60 52 16 "Cancel"
  277. EndDef
  278.  
  279. ;
  280. ; dialog NetMessageDial Edit1$, Edit2$, Edit3$, OK1, Cancel1
  281. ;
  282.  
  283.  
  284.  
  285.  
  286.  
  287.  
  288. ;Routines for NetUsername
  289. ;
  290. procedure Net_Username
  291.     a$=NETUSERNAME$()
  292.     Messagebox("User Name",a$,0)
  293. endproc
  294.