将vb.net转换为asp Classic

时间:2012-12-11 18:40:59

标签: asp-classic

我有以下VB代码:

 Dim value As Date = Date.Now
    Dim intHour As Integer
    Dim intMinute As Integer
    Dim intSecond As Integer


    intHour = 17
    intMinute = 0
    intSecond = 0

    Dim newdatetime As DateTime = New Date(value.Year, value.Month, value.Day, intHour, intMinute, intSecond)

    If DateTime.Now < newdatetime Then

        If value.DayOfWeek = DayOfWeek.Saturday Then
            value = value.AddDays(2)
            Return value
        End If

        If value.DayOfWeek = DayOfWeek.Sunday Then
            value = value.AddDays(1)
            Return value
        End If

        Return value

    ElseIf DateTime.Now > newdatetime Then
        Do
            value = value.AddDays(1)
        Loop While (value.DayOfWeek = DayOfWeek.Saturday) Or (value.DayOfWeek = DayOfWeek.Sunday)
        Return value
    End If

在ASP CLassic中会怎样?

有人可以帮忙吗?

编辑:

    Dim CurrentDate
CurrentDate = Date()

Dim intHour
Dim intMinute
Dim intSecond

intHour = 17
intMinute = 0
intSecond = 0

Dim NewDate
Dim NewDate1
Dim NewDate2

NewDate = DatePart("yyyy", CurrentDate)
NewDate1 = DatePart("m", CurrentDate)
NewDate2 = DatePart("d", CurrentDate)


Dim Dates 

Dates = DateSerial(NewDate, NewDate1, NewDate2)

Dim Time 

Time = TimeSerial(intHour, intMonth, intSecond)