Private Function GetRandomizeNo() Function GetRandomizeNo() As Integer '功能说明:生成随机验证码 Dim RandomizeNo As Integer Randomize() RandomizeNo = 9999 * Rnd() + 1000 If (RandomizeNo).ToString.Length >= 5 Then RandomizeNo = Val(RandomizeNo.ToString.Substring(0, 4)) End If Return RandomizeNo End Function Dim RandomizeNo As Integer Randomize () Dim ranNum As Integer = 90000 * Rnd () + 10000 Dim fn As String = Now().ToString( " yyMMddHHmmff " ) & ranNum & ext hip.PostedFile.SaveAs(Server.MapPath( " ../dwe/upload/ " & fn)) 转载于:https://www.cnblogs.com/T_98Dsky/archive/2005/06/28/182359.html