CSDN博客

img xuandhu

文件处理的一些资料收集

发表于2004/10/25 16:30:00  802人阅读

获取文件名
 Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

        If Not (aa.PostedFile Is Nothing) Then

            Dim nam As String = aa.PostedFile.FileName
            Dim i As Integer = nam.LastIndexOf(".")
            Dim newext As String = nam.Substring(i)
            newext = DateTime.Now.Year.ToString() + DateTime.Now.Month.ToString + DateTime.Now.Day.ToString + DateTime.Now.Hour.ToString + DateTime.Now.Minute.ToString + DateTime.Now.Second.ToString + newext
            '  Response.Write(newext)

            Response.Write(aa.PostedFile.FileName)
            Response.Write("<BR>")


            aa.PostedFile.SaveAs(Server.MapPath("~/IMAGES/" & newext))
        End If
    End Sub

阅读全文
0 0

相关文章推荐

img
取 消
img