各位大侠看看

解决方案 »

  1.   

    如何在asp.net中点击按纽后弹出保存文件对话框(vb.net)
      

  2.   

    使用html的控件File Field 
    即 <INPUT style="Z-INDEX: 101; LEFT: 248px; POSITION: absolute; TOP: 192px" type="file">html代码如下:
    <%@ Page language="c#" Codebehind="WebForm2.aspx.cs" AutoEventWireup="false" Inherits="TestWebApp.WebForm2" %>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
    <HTML>
    <HEAD>
    <title>WebForm2</title>
    <meta name="GENERATOR" Content="Microsoft Visual Studio .NET 7.1">
    <meta name="CODE_LANGUAGE" Content="C#">
    <meta name="vs_defaultClientScript" content="JavaScript">
    <meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5">
    </HEAD>
    <body MS_POSITIONING="GridLayout">
    <form id="Form1" method="post" runat="server">
    <FONT face="宋体"><INPUT style="Z-INDEX: 101; LEFT: 248px; POSITION: absolute; TOP: 192px" type="file"></FONT>
    </form>
    </body>
    </HTML>测试通过
      

  3.   

    也可以使用javascript
    代码如下:<html>
    <head>
    <meta http-equiv="Content-Language" content="zh-cn">
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
    <meta name="GENERATOR" content="Microsoft FrontPage 4.0">
    <meta name="ProgId" content="FrontPage.Editor.Document">
    <title>New Page 1</title>
    </head>
    <SCRIPT LANGUAGE="javascript">
    function SaveFile()
    {
      try
      {
        var xlsWindow = window.open("","_blank","left=-1,top=-1,width=100,height=100");
        xlsWindow.document.execCommand('Saveas',true,'%homeDrive%\\new_file.txt')
        xlsWindow.close();
      }
      catch(e)
      {}
    }</script>
    <body>
    <form>
    <input type="button" value="button" onclick="SaveFile()" ID="Button1" NAME="Button1">
    </form>
    </body>
    </html>测试通过
      

  4.   

    function SaveFile()
    { document.execCommand('Saveas',true,'%
    }