以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.net/bbs/index.asp)
--  专家坐堂  (http://foxtable.net/bbs/list.asp?boardid=2)
----  [求助]如何显示星期  (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=40076)

--  作者:石四
--  发布时间:2013/9/8 17:27:00
--  [求助]如何显示星期

希望显示登陆时间和星期,这样不行:

Dim lb3 As WinForm.Label
Dim d As Date = Date.Today
lb3 = e.Form.Controls("Label2")
lb3.Text = "登录日期:" & Date.Today() & d.DayOfWeek
没报错,但是只显示日期,没显示星期。

正确的代码是怎样的?


--  作者:lsy
--  发布时间:2013/9/8 17:43:00
--  
Dim s() As String = {"日","一","二","三","四","五","六"}
Output.Show("登录日期:" & Format(Date.Today(),"yyyy年MM月dd日") & " 星期" & s(Date.Today().DayOfWeek))

--  作者:石四
--  发布时间:2013/9/12 14:40:00
--  

按楼上的指点,改成:

 

Dim lb3 As WinForm.Label
Dim s() As String = {"日","一","二","三","四","五","六"}

lb3 = e.Form.Controls("Label2")
lb3.Text = "登录日期:" & Date.Today() & " 星期 " & s(Date.Today().DayOfWeek)