我正在使用以下代码:
Try
Dim j As Integer = 0
Dim hfc As HttpFileCollection = Request.Files
Dim PathName As String
For i As Integer = 0 To hfc.Count - 1
Dim hpf As HttpPostedFile = hfc(i)
If hpf.ContentLength > 0 Then
Try
hpf.SaveAs(Server.MapPath("~/F:\ImageUploaded\") & System.IO.Path.GetFileName(hpf.FileName))
Catch
PathName = Server.MapPath(hpf.FileName)
Session("PathName") = PathName
End Try
End If
Next
Catch generatedExceptionName As Exception
Throw
End Try
hfc.count总是得零值。如何解决这个问题?
下面的是我的文件上载控件
< asp:FileUpload ID="FileUpload1" runat="server" />