Dim FileExten As String = System.IO.Path.GetExtension(FileUpload1.PostedFile.FileName)

Select Case FileExten.ToUpper
    Case ".DOC"
 Response.Write(FileExten.ToUpper)
    Case ".ZIP"
 Response.Write(FileExten.ToUpper)
    Case ".XLS"
 Response.Write(FileExten.ToUpper)
    Case Else
 Response.Write("都不是")
End Select

goodlucky 發表在 痞客邦 PIXNET 留言(0) 人氣()