home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
DP Tool Club 19
/
CD_ASCQ_19_010295.iso
/
vrac
/
sendfile.zip
/
SENDFILE.WCC
< prev
next >
Wrap
Text File
|
1994-11-10
|
3KB
|
131 lines
' SendFile v1.02, Multi-Node aware, Auto-File sending Util
CarrierCheck ON
Dim ConfigFile As String
Dim Exclude1 As String
Dim Exclude2 As String
Dim Exclude3 As String
Dim Exclude4 As String
Dim Exclude5 As String
Dim fRec As FileRecord
Dim FileToSend1 As String
Dim FileToSend2 As String
Dim Ok As Integer
Dim SentUserTemp As String
Dim SentFile As Integer
Dim TodayNow As DateTime
Dim Work As String
CurrentDateTime(TodayNow)
Function ChkConfig
ConfigFile = ProgPath + "sendfile.cfg"
If Exists(ConfigFile) Then
Open ConfigFile For Input As #1
While Not EOF(1)
Input #1, Work
Work = uCase(work)
If Instr(Work, "EXCLUDE1=") = 1 Then Exclude1 = Rtrim(mid(Work,10,20))
If Instr(Work, "EXCLUDE2=") = 1 Then Exclude2 = Rtrim(mid(Work,10,20))
If Instr(Work, "EXCLUDE3=") = 1 Then Exclude3 = Rtrim(mid(Work,10,20))
If Instr(Work, "EXCLUDE4=") = 1 Then Exclude4 = Rtrim(mid(Work,10,20))
If Instr(Work, "EXCLUDE5=") = 1 Then Exclude5 = Rtrim(mid(Work,10,20))
If Instr(Work, "FILETOSEND1=") = 1 Then FileToSend1 = Rtrim(mid(Work,13,80))
If Instr(Work, "FILETOSEND2=") = 1 Then FileToSend2 = Rtrim(mid(Work,13,80))
Wend
Close #1
Else
Open "sendfile.err" For Append As #2
CarrierCheck Off
LockFile(2,0,1)
Print #2, "-------------------------------------------------------------------------------"
Print #2, FormatDate(TodayNow.d,"mm/dd/yy ") ;
Print #2, FormatTime(TodayNow.t,"hh:mm:ss ") ;
Print #2, " SendFile Error Log File"
Print #2, " * You Need to Create a SENDFILE.CFG File"
Print #2, " * Please refer to SENDFILE.DOC for more Information"
UnLockFile(2,0,1)
CarrierCheck On
Close
End
End If
End Function
Function ChkUser
Ok = False
If User.SecLevel = Exclude1 Then
Close
End
ElseIf User.Seclevel = Exclude2 Then
Close
End
ElseIf User.Seclevel = Exclude3 Then
Close
End
ElseIf User.Seclevel = Exclude4 Then
Close
End
ElseIf User.Seclevel = Exclude5 Then
Close
End
Else
Ok = True
End If
End Function
ChkConfig
ChkUser
FileToSend1 = uCase(FileToSend1)
FileToSend2 = uCase(FileToSend2)
If Ok = True Then
Open ProgPath + "sentuser.lst" For Input As #3
Do While Not EOF(3)
SentUserTemp = uCase(SentUserTemp)
Input #3, SentUserTemp
If SentUserTemp = User.Name Then
SentFile = True
Exit Do
Else
SentFile = False
End If
Loop
End If
Close #3
If SentFile = False Then
CLS
DisplayFile "senduse1"
WaitEnter
If FileToSend1 <> "" Then
SendFile FileToSend1
If GetFileInfo(fRec, FileToSend1) Then
fRec.Downloads = fRec.Downloads + 1
fRec.LastAccess = TodayNow
UpdateFile(fRec)
End If
End If
If FileToSend2 <> "" Then
SendFile FileToSend2
If GetFileInfo(fRec, FileToSend2) Then
fRec.Downloads = fRec.Downloads + 1
fRec.LastAccess = TodayNow
UpdateFile(fRec)
End If
End If
CLS
DisplayFile "senduse2"
WaitEnter
Open ProgPath + "sentuser.lst" For Append As #4
If User.Name <> "" Then
CarrierCheck Off
LockFile(4,0,1)
Print #4, User.Name
UnLockFile(4,0,1)
CarrierCheck On
End If
End If
Close
End