see here:
viewtopic.php?t=11095
i found severel bugs. The crypted of UserName+Pass is wrong. The error-code-check is wrong (it could happen, that a 404-file not found is detected, when in the tag-string is a "404"), not all errors are detected, use of threads -> unsecure.
And finaly:
With this code you can analyse the date from the server.
Code: Select all
Dim wkday$(6)
Dim weekday$(6)
Dim Month$(12)
wkday$(1)="MON"
wkday$(2)="TUE"
wkday$(3)="WED"
wkday$(4)="THU"
wkday$(5)="FRI"
wkday$(6)="SAT"
wkday$(0)="SUN"
weekday$(1)="MONDAY"
weekday$(0)="TUESDAY"
weekday$(0)="WEDNESDAY"
weekday$(0)="THURSDAY"
weekday$(0)="FRIDAY"
weekday$(0)="SATURDAY"
weekday$(0)="SUNDAY"
Month$(1)="JAN"
Month$(2)="FEB"
Month$(3)="MAR"
Month$(4)="APR"
Month$(5)="MAY"
Month$(6)="JUN"
Month$(7)="JUL"
Month$(8)="AUG"
Month$(9)="SEP"
Month$(10)="OCT"
Month$(11)="NOV"
Month$(12)="DEC"
; 1 2 3 4 5
;TestTime$="Sun, 06 Nov 1994 08:49:37 GMT"
; 1 2 3
;TestTime$="Sunday, 06-Nov-94 08:49:37 GMT"
; 1 2 3 4 5
TestTime$="Sun Nov 6 08:49:37 1994"
TestTime$=ReplaceString(Trim(UCase(TestTime$))," "," ")
Day=0:Month$="":Year=0:Time$=""
For i=0 To 6
If Left(TestTime$,4)=wkday$(i)+","
Debug "rfc1123-Date"
;{
Day=Val(StringField(TestTime$,2," "))
Month$=StringField(TestTime$,3," ")
Year=Val(StringField(TestTime$,4," "))
Time$=StringField(TestTime$,5," ")
;}
ElseIf Left(TestTime$,Len(weekday$(i))+1)=weekday$(i)+","
Debug "rfc850-Date"
;{
SubTime$=StringField(TestTime$,2," ")
Day=Val(StringField(SubTime$,1,"-"))
Month$=StringField(SubTime$,2,"-")
Year=Val(StringField(SubTime$,3,"-"))
If Year>80:Year+1900:Else:Year+2000:EndIf
Time$=StringField(TestTime$,3," ")
;}
ElseIf Left(TestTime$,4)=wkday$(i)+" "
Debug "asctime-Date"
;{
Day=Val(StringField(TestTime$,3," "))
Month$=StringField(TestTime$,2," ")
Year=Val(StringField(TestTime$,5," "))
Time$=StringField(TestTime$,4," ")
;}
EndIf
Next
For i=1 To 12
If Month$(i)=Month$ : Month=i : EndIf
Next
Date=ParseDate("%hh:%ii:%ss",Time$)
Hour=Hour(Date)
Min=Minute(Date)
Sec=Second(Date)
Date=Date(Year,Month,Day,Hour,Min,Sec)
Debug FormatDate("%dd.%mm.%yyyy %hh:%ii:%ss",Date)