Maping Drive

Terlampir coding maping drive dalam sebuah perusahan dan Mohon Maaf Karena kerahasiaan data ada beberapa coding tidak saya tampilkan

#include “minigui.ch”

#ifdef __HARBOUR__
#xcommand TRY => BEGIN SEQUENCE WITH s_bBreak
#xcommand CATCH [] => RECOVER [USING ]
#xcommand FINALLY => ALWAYS
static s_bBreak := { |oErr| break( oErr ) }
#endif

memvar lgImpos,lgImpos1,lgImpos2

Function Main()

Private lgImpos,lgImpos1,lgImpos2
SET LANGUAGE TO English

lgTITLE:=”Network Drive mapping”
lgStat:= ‘Network Connection Tayoh Sarana Sukses by Design : Supriadi’
lgbtn1:= ‘Map a Network Drive’
lgbtn2:= ‘Remove Mapped Drive’
lgbtn3:= ‘Is Drive Mapped ?’
lgbtn3Y:=”Mapped to ”
lgbtn3N:=”Not mapped”
lgImpos:=”Unable to map ”
lgImpos1:=” to ”
lgImpos2:=” Unable to remove ”

DEFINE WINDOW DRVMAP ;
AT 0,0 ;
WIDTH 400 + GetBorderWidth() ;
HEIGHT 480 ;
TITLE “Maping Drive Java Computer System Network” ;
MAIN ;
NOMAXIMIZE NOSIZE

DRAW GRADIENT IN WINDOW DRVMAP AT 10,0 TO 430,50;
VERTICAL BORDER BOX ;
BEGINCOLOR {0,128,197,} ;
ENDCOLOR {255,197,255}

DEFINE STATUSBAR
STATUSITEM lgStat
END STATUSBAR

define image tayoh
row 10
col 10
width 420
height 420
picture ‘c:\maping\tayoh2.gif’
end image

@ 150,80 buttonex ema ;
caption ‘Ms. Emma ‘ ;
picture ‘c:\maping\ema.bmp’;
tooltip ‘Koneksi Ke Komputer ibu Hilma. ‘;
height 40 ;
width 100 ;
FONT ‘Arial’ ;
SIZE 9;
ON CLICK DriveMapping( cDriveLetter1, cRemotePath1 ,.F. , cUserName1, cPassword1)

@ 200,80 buttonex sri ;
caption ‘Ms. Srie ‘ ;
picture ‘c:\maping\sri.bmp’;
tooltip ‘Koneksi Ke Komputer ibu Sri Napsiah’ ;
height 40 ;
width 100 ;
FONT ‘Arial’ ;
SIZE 9;
ON CLICK DriveMapping( cDriveLetter2, cRemotePath2 ,.F. , cUserName2, cPassword2)

@ 250,80 buttonex nia ;
caption ‘Ms.Nia ‘ ;
picture ‘c:\maping\nia.bmp’;
tooltip ‘Koneksi Ke Komputer ibu Nia Furi Angraeni’;
height 40 ;
width 100 ;
FONT ‘Arial’ ;
SIZE 9;
ON CLICK DriveMapping( cDriveLetter3, cRemotePath3 ,.F. , cUserName3, cPassword3)

@ 300,80 buttonex eri ;
caption ‘Ms.Eri ‘ ;
picture ‘c:\maping\eri.bmp’;
tooltip ‘Koneksi Ke Komputer ibu Eri Elkotieb’;
height 40 ;
width 100 ;
FONT ‘Arial’ ;
SIZE 9;
ON CLICK DriveMapping( cDriveLetter4, cRemotePath4 ,.F. , cUserName4, cPassword4)

@ 150,240 buttonex gatot ;
caption ‘Mr. Gatot ‘ ;
picture ‘c:\maping\gatot.bmp’;
tooltip ‘Koneksi Ke Komputer Bapak Gatot Sutrisno’;
height 40 ;
width 100 ;
FONT ‘Arial’ ;
SIZE 9;
ON CLICK DriveMapping( cDriveLetter5, cRemotePath5 ,.F. , cUserName5, cPassword5)

@ 200,240 buttonex wahyu ;
caption ‘Mr.Wahyu ‘ ;
picture ‘c:\maping\wahyu.bmp’;
tooltip ‘Koneksi Ke Komputer Bapak Wahyu Prasetyo’;
height 40 ;
width 100 ;
FONT ‘Arial’ ;
SIZE 9;
ON CLICK DriveMapping( cDriveLetter5, cRemotePath5 ,.F. , cUserName5, cPassword5)

@ 250,240 buttonex Totok ;
caption ‘Mr.Totok M’;
picture ‘c:\maping\totok.bmp’;
tooltip ‘Koneksi Ke Komputer Bapak Totok Muslimat’;
height 40 ;
width 100 ;
FONT ‘Arial’ ;
SIZE 9;
ON CLICK DriveMapping( cDriveLetter5, cRemotePath5 ,.F. , cUserName5, cPassword5)

@ 300,240 buttonex haryono ;
caption ‘Mr.Haryono’;
picture ‘c:\maping\haryono.bmp’;
tooltip ‘Koneksi Ke Komputer Bapak Haryono Sutjipto’;
height 40 ;
width 100 ;
FONT ‘Arial’ ;
SIZE 9;
ON CLICK DriveMapping( cDriveLetter5, cRemotePath5 ,.F. , cUserName5, cPassword5)

END WINDOW

CENTER WINDOW DRVMAP

ACTIVATE WINDOW DRVMAP

Return NIL

Function DriveMapping(cDriveLetter,cRemotePath,lPermanent,cUserName,cPassword)
Local oNetwork

DEFAULT lPermanent:=.F.

oNetwork:=CreateObject(“WScript.Network”)
TRY
oNetwork:MapNetworkDrive(cDriveLetter, cRemotePath,lPermanent,cUserName,cPassword)
CATCH
MsgInfo(lgImpos+cDriveLetter+ lgImpos1 +cRemotePath)
END
Return NIL

Function RemoveDriveMapping(cDriveLetter)
Local oNetwork

oNetwork:=CreateObject(“WScript.Network”)
TRY
oNetwork:RemoveNetworkDrive(cDriveLetter)
CATCH
MsgInfo(lgImpos2+cDriveLetter)
END
Return NIL

Function Ismappeddrive(cDriveLetter)
Local oNetwork,oNetworkDrives,i,lAlreadyConnected:=.F.

oNetwork:=CreateObject(“WScript.Network”)
oNetworkDrives:=oNetwork:EnumNetworkDrives()

For i:=0 to oNetworkDrives:Count – 1 STEP 2
if Upper(oNetworkDrives:Item(i)) == Upper(cDriveLetter)
lAlreadyConnected:=.T.
Endif
Next
Return lAlreadyConnected

Tinggalkan Balasan

Isikan data di bawah atau klik salah satu ikon untuk log in:

Logo WordPress.com

You are commenting using your WordPress.com account. Logout / Ubah )

Gambar Twitter

You are commenting using your Twitter account. Logout / Ubah )

Foto Facebook

You are commenting using your Facebook account. Logout / Ubah )

Foto Google+

You are commenting using your Google+ account. Logout / Ubah )

Connecting to %s

%d blogger menyukai ini: