| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 1046 人关注过本帖
标题:幫心找一下錯誤!!!!
取消只看楼主 加入收藏
xunmi_love
Rank: 2
等 级:论坛游民
帖 子:204
专家分:18
注 册:2006-10-14
结帖率:57.14%
收藏
 问题点数:0 回复次数:0 
幫心找一下錯誤!!!!
<%@ 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]
搜索更多相关主题的帖子: FileExt Namespace Import Data System 
2008-06-26 17:44
快速回复:幫心找一下錯誤!!!!
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.036712 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved