在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
这是asp.net实现文件上传的代码程序。只是一个示例,你可以根据自己的要求进行修改。
<%@ page Language = "C#"%>
<%@ Import Namespace = "System.IO" %> <script language = "C#" runat = "server"> >
<html>
<head> <title>上传文件</title> </head> <body> <div align="center"> <table width="100%" border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#eeeeee" id="AutoNumber1"> <form id="formFile" method="post" action="" enctype="multipart/form-data" runat="server"> <tr> <td align="center"> <input type="file" id="inputFile" name="inputFile" runat="server" size="64"> </td> </tr> <tr> <td align="center"> <input type="button" value="Upload" OnServerClick="uploadFile" id="Button1" name="Button1" runat="server"> </td> </tr> <tr> <td align="center"> <asp:Label id="labelUpResult" runat="server" text="" font-bold="True" forecolor="#FF0000"/><br> <asp:Label id="labelFileName" runat="server" text="" font-bold="True" forecolor="#FF0000"/><br> <asp:Label id="labelFileExt" runat="server" text="" font-bold="True" forecolor="#FF0000"/><br> <asp:Label id="labelFileSize" runat="server" text="" font-bold="True" forecolor="#FF0000"/><br> </td> </tr> </form> </table> </div> </body> </html>
|
请发表评论