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

ASP.NET 檔案下載

//TransmitFile实现下载
    protected void Button1_Click(object sender, EventArgs e)
    {
        /*
        微软为Response对象提供了一个新的方法TransmitFile来解决使用Response.BinaryWrite
        下载超过400mb的文件时导致Aspnet_wp.exe进程回收而无法成功下载的问题。
        代码如下:
        */
        Response.ContentType = "application/x-zip-compressed";
        Response.AddHeader("Content-Disposition", "attachment;filename=z.zip");
        string filename = Server.MapPath("DownLoad/z.zip");
        Response.TransmitFile(filename);
    }
    //WriteFile实现下载
    protected void Button2_Click(object sender, EventArgs e)
    {
        /*
        using System.IO;
        */
        string fileName = "asd.txt";//客户端保存的文件名
        string filePath = Server.MapPath("DownLoad/aaa.txt");//路径
        FileInfo fileInfo = new FileInfo(filePath);
        Response.Clear();
        Response.ClearContent();
        Response.ClearHeaders();
        Response.AddHeader("Content-Disposition", "attachment;filename=" + fileName);
     


相关文档:

Asp.Net认证和授权扩展

原来的Membership
    我们知道在Asp.Net 2.0中微软就为我们提供了强大的权限管理功能来帮助我们管理Asp.Net相应的权限,其实它是对我们的身份认证和权限管理的一种抽象。这里简单的了解一下Membership:
我们应该知道微软关于认证方面给我们提供了三种认证方式windows 、Forms、Passport,我想熟悉Asp.Net ......

JQuery调用asp.net后台方法

利用JQuery的$.ajax()可以很方便的调用asp.net的后台方法。
先来个简单的实例热热身吧。
1、无参数的方法调用
asp.net code:
using System.Web.Script.Services;
[WebMethod]
public static string SayHello()
{
return "Hello Ajax!";
}
注意:1.方法一定要静态方法,而且要有[WebMethod]的声明
JQuery ......

[分享]ASP.net一个空间多个网站的设置

看到有人提问一个空间支持多个网站的问题。
总结一下:
最好保证各个项目app_code内的文件都是一样的。
因为生成多个项目必定生成多个App_Code.dll,
由于所有dll放在同一个bin目录,所以要保证app_code内的文件一样。
发布前所有项目aspx文件的 Inherits="menulefttb" 中的名字不能相同。
将每个项目发布后生成的dll ......

ASP.NET web app performance issue ThreadPool

 
One of my bank customers planned to roll out a new ASP.NET web application serving as their critical internet banking portal. They faced some weird performance issue in their UAT environment. They noticed the CPU utilization was really high (above 90%) without any fluctuation. After checking ......

asp.net网页播放器

之前要完成一个支持多支持多种格式的视频播放器,在网上找到一个VB写的,然后改成C#,近段在网上也见有不少人问这个问,在此分享
public class VideoPlayer
    {
        /// <summary>
        /// 生成视频播放器的HTM ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号