2012-12-11 113 views
0

我有以下VB代码:转换vb.net到ASP经典

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经典?

有人可以帮忙吗?

编辑:

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) 
+0

我的问题是,我不知道如何在ASP Classic中使用日期和时间。 – Paks

+0

This this here:http://www.w3schools.com/vbscript/vbscript_ref_functions.asp – rekire

+0

我已经做了一些事情。我怎么能把“日期”和“时间”放在一起? – Paks

回答

1
+0

谢谢,你能看看我的问题吗?我写了一些东西,但现在我不知道如何把“日期”和“时间”放在一起。 VB。我没有发现任何东西 – Paks

+0

感谢您的帮助。链接帮助我解决了我的问题 – Paks