有一个asp.net上传文件问题,表单是<INPUT TYPE="file" id="uploadfile" runat="server">
过程是SubEnter_Click(senderAsObject,EAsEventArgs)Dimfilename,filepathAsStringfilename=Pa...
过程是
Sub Enter_Click(sender As Object, E As EventArgs) Dim filename,filepath As String
filename=Path.GetFileName(uploadfile.PostedFile.Filename)//为什么在这行提醒uploadfile未声明呢??一直没有编译成功,和id里名字一样啊,这怎么回事???
filepath="E:\webSite1\CMS\upload\" & filename
uploadfile.PostedFile.saveas(filepath)
message.innerHtml="文件已成功上传,详细信息如下"
message.innerhtml &="<br>文件名称:" & filename
message.innerhtml &="<br>文件大小:" & uploadfile.postedfile.Contentlength & " 字节"
message.innerhtml &="<br>文件类型:" & uploadfile.postedfile.Contenttype
message.innerhtml &="<br>文件说明:" & intro.value
End Sub
我这是照着书上写的呢,为什么就编译失败呢,各位帮帮忙! 展开
Sub Enter_Click(sender As Object, E As EventArgs) Dim filename,filepath As String
filename=Path.GetFileName(uploadfile.PostedFile.Filename)//为什么在这行提醒uploadfile未声明呢??一直没有编译成功,和id里名字一样啊,这怎么回事???
filepath="E:\webSite1\CMS\upload\" & filename
uploadfile.PostedFile.saveas(filepath)
message.innerHtml="文件已成功上传,详细信息如下"
message.innerhtml &="<br>文件名称:" & filename
message.innerhtml &="<br>文件大小:" & uploadfile.postedfile.Contentlength & " 字节"
message.innerhtml &="<br>文件类型:" & uploadfile.postedfile.Contenttype
message.innerhtml &="<br>文件说明:" & intro.value
End Sub
我这是照着书上写的呢,为什么就编译失败呢,各位帮帮忙! 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询