流水號程式

下列程式要加入些什麼後三碼的會因為系統的年改變而變回001? Dim a = 0 Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim ss = "" a += 1 ss += IIf(a / 10 > 1, "", "0") ss += IIf(a / 100 > 1,... show more 下列程式要加入些什麼後三碼的會因為系統的年改變而變回001?
Dim a = 0
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim ss = ""

a += 1

ss += IIf(a / 10 > 1, "", "0")

ss += IIf(a / 100 > 1, "", "0")

ss += LTrim(Str(a))


TextBox1.Text = CStr(Year(Now)) + IIf(Month(Now) > 9, "", "0") + CStr(Month(Now)) + ss

End Sub
End Class
1 answer 1