幫心找一下錯誤!!!!
<%@ Page Language="VB" ContentType="text/html" ResponseEncoding="big5" %><[email=%@Import]%@Import[/email] Namespace =Namespace="System.Data"%>
<[email=%@Import]%@Import[/email] Namespace="System.Data.OleDb"%>
<script runat="server">
Sub UploadFile(sender As Object, e As EventArgs)
Dim FileExt
FileExt = LCase(Right(Trim(FileUp.Value),3))
If FileExt = "gif" Or FileExt = "jpg" Or FileExt = "bmp" Or FileExt = "png" Or FileExt = "tif" Or LCase(Right(Trim(FileUp.Value),4)) = "jpeg" Then
If FileUp.PostedFile.ContentLength = 0 Then
FileInfo.Visible = False
Exit Sub
Else
FileInfo.Visible = True
End If
FSize.Text = CStr(FileUp.PostedFile.ContentLength)
FName.Text = FileUp.PostedFile.FileName
Dim FileSplit() As String = Split( FileUp.PostedFile.FileName, "/" )
Dim FileName As String = FileSplit(FileSplit.Length-1)
FileUp.PostedFile.SaveAs( Server.MapPath(".") & "/Upload/" & FileName )
Dim objCommand As OleDbCommand
Dim objConnection As OleDbConnection
objConnection = New OleDbConnection("Provider=Microsoft.Jet.OleDb.4.0;Data Source="+Server.MapPath("Upload.mdb"))
objCommand = New OleDbCommand("Insert Into Upload (FilePath) Values ('Upload/"+FileName+"')" , objConnection)
Dim Exts() As String = Split( FileName, "." )
Dim Ext As String = LCase(Exts(Exts.Length-1))
If Ext <> "jpg" And Ext <> "jpeg" And Ext <> "gif" And Ext <> "txt" And Ext <> "htm" And Ext <> "html" Then
FDisplay.Visible = False
Else
FDisplay.Text = "<A Target='_blank' HREF='Upload/" & _
FileName & "'>上传文件</A>"
End If
Response.Write("上传成功!")
Else
' Msgbox("对不起,只能上传扩展名为gif、jpg、bmp、png、tif或jpeg等图片文件!",65,"a")
Response.Write("对不起,只能上传扩展名为gif、jpg、bmp、png、tif或jpeg等图片文件!")
End If
End Sub
</script>
<Html>
<head>
<title>文件上传</title>
</head>
<Body BgColor=White>
<H3>上传文件<Hr></H3>
<Form Name="Form1" Enctype="multipart/form-data" runat="server">
上传文件
<Input Type="File" id="FileUp" runat="server"><P>
<Asp:button id="Upload" Text="Upload"
runat="server"/>
</form><Hr>
<Div id="FileInfo" Visible="False" runat="server">
上传文件名 <Asp:Label id="FName" runat="server"/><br>
上传文件大小 <Asp:Label id="FSize" runat="server"/><br>
<Asp:Label id="FDisplay" runat="server"/>
</Div>
</Body>
</Html>
編譯錯誤 描述: 資源編譯無法完成 (錯誤發生於服務要求)。請檢閱下列的特定錯誤詳細資料,並視情況修改您的原始程式碼。
編譯器錯誤訊息: BC30183: 關鍵字做為識別項無效。
原始程式錯誤:
[沒有相關的原始程式碼] |
[font=Verdana]原始程式檔: C:\WINDOWS\\Framework\v2.0.50727\Temporary Files\root\67a5b378\2db99554\App_Web_uploadfile.aspx.cdcab7d2.tauisay6.0.vb 行: 15 [/font]