易截截图软件、单文件、免安装、纯绿色、仅160KB

Asp.net 文件上传(Vb.net版)

在Asp.net中实现文件的上传功能,是非常简单的一件事情,只需要利用微软提供的FileUpload控件即可轻松实现。
LargeFileUpload.aspx代码如下
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="LargeFileUpload.aspx.vb"
    Inherits="LargeFileUpload" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Upload LargeFile</title>
</head>
<body>
    <form id="form1" runat="server" enctype="multipart/form-data">
<! 注意在form中必须有enctype="multipart/form-data",表示表单中有上传文件,否则文件无法上传>
        <div>
            <center>
                <asp:FileUpload ID="FileUpload1" runat="server" Width="336px" /><br />
<!runat="server" 表示此控件是服务器控件>
                <asp:Button ID="btnUpload" runat="server" Text="Upload" />
                <asp:Button ID="btnReset" runat="server" Text="Reset" />
            </center>
        </div>
    </form>
</body>
</html>LargeFileUpload.aspx.vb代码如下:Partial Class LargeFileUpload
    Inherits System.Web.UI.Page
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        If Me.IsPostBack Then
            'Upload file
            Call UploadFiles()
        End If
    End Sub
    Private Sub UploadFiles()
        Try
         


相关文档:

VB使用手形的图标

Option Explicit
Private Declare Function LoadCursor Lib "user32.dll" Alias "LoadCursorA" (ByVal hInstance As Long, ByVal lpCursorName As Long) As Long
Private Declare Function SetCursor Lib "user32.dll" (ByVal hCursor As Long) As Long
Private Const IDC_HAND As Long = 32649
Private myHand_handle ......

ASP.NET的母版知识摘要


母版页面
-- 新建一母版页面
-- 在适当位置加入代码:
<asp:ContentPlaceHolder ID="ContentPlaceHolder3" runat="server">
...这之间的内容如果没有Content内容,将会得到显示;
...如果有Content内容,将会被Content内容替换掉
</asp:ContentPlaceHolder>
Content页面
-- 新建一WEB窗体
-- 在适当 ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号