C# web 怎么调出打印和另存为对话框

sweetqueen1 2010-09-15 07:18:02
如题,我要在页面上加两个按钮,一个打印按钮,一个另存为按钮。调出本机上的打印对话框和另存为对话框、、

另存为的时候,将页面的信息存储为txt格式,要怎么设置?

网页上的文件--另存为,文件--打印 功能 ,这个不需要
需求是要用按钮调用、、、
...全文
161 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
sweetqueen1 2010-09-18
  • 打赏
  • 举报
回复
唉、、沒人回、、自己解決了一下、、大致功能還行 、、分給你們吧、、
sweetqueen1 2010-09-16
  • 打赏
  • 举报
回复
頂一下 怎麼調出另存為 對話框啊?
zyj_604 2010-09-15
  • 打赏
  • 举报
回复
window.print()
这些函数,可以找些网站看看啊。有些网站带着打印功能,你看他们调的什么函数啊
wuyq11 2010-09-15
  • 打赏
  • 举报
回复
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);
}
}

111,129

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Creator Browser
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧