如题,我要在页面上加两个按钮,一个打印按钮,一个另存为按钮。调出本机上的打印对话框和另存为对话框、、另存为的时候,将页面的信息存储为txt格式,要怎么设置?网页上的文件--另存为,文件--打印 功能 ,这个不需要
需求是要用按钮调用、、、

解决方案 »

  1.   

    onclick="window.print()"
    HttpRequest.SaveAs 
    document.execCommand('Saveas',false,'c:\\a.htm')>
    public void WriteFile(string content, string fileSavePath)
    {
               if (System.IO.File.Exists(fileSavePath))
            {
                System.IO.File.Delete(fileSavePath);
            }
            using (System.IO.FileStream fs = System.IO.File.Create(fileSavePath)) 
            {
                byte[] info = new System.Text.Encoding.GetEncoding("gb2312").GetBytes(content);   
                fs.Write(info, 0, info.Length);
            }
    }onclick="window.print()"
    HttpRequest.SaveAs 
    document.execCommand('Saveas',false,'c:\\a.htm')>
    public void WriteFile(string content, string fileSavePath)
    {
               if (System.IO.File.Exists(fileSavePath))
            {
                System.IO.File.Delete(fileSavePath);
            }
            using (System.IO.FileStream fs = System.IO.File.Create(fileSavePath)) 
            {
                byte[] info = new System.Text.Encoding.GetEncoding("gb2312").GetBytes(content);   
                fs.Write(info, 0, info.Length);
            }
    }
      

  2.   

    window.print()
    这些函数,可以找些网站看看啊。有些网站带着打印功能,你看他们调的什么函数啊