一个图片站,用户要点数来看图.怎样防止用户用flashget等工具或知道真图的路径后直接打图的网址看,请帮说一个解决方案,谢谢!

解决方案 »

  1.   

    你可以采用图片防盗链
    这里有很多源代码http://www.google.com/search?hl=zh-CN&q=asp.net+%E9%98%B2%E7%9B%97%E9%93%BE&lr=
      

  2.   

    这个 需要你 
    把真实的 图片地址隐藏掉使用一个专门的 loadpic.aspx文件 来 读取真实图片
    并输出在这个文件里面 即可判断用户权限.
      

  3.   

    可把图片放在虚拟目录之外的地方.用一个专门的页面.判断权限后通过writeFile的方式输出.
      

  4.   

    自己写一个专门对图片的http处理程序吧
      

  5.   

    用HttpModule过滤请求,例如你用Forms验证的话就用同样的验证来过滤请求。
      

  6.   

    你在webconfig文件里设置下不允许匿名用户浏览不就可以了.
      

  7.   

    在以前公司时候做的
    可以实现楼主需要 loadpic.aspx
    <%@ Page language="c#" Codebehind="loadpic.aspx.cs" AutoEventWireup="false" Inherits="Wireless_Album.loadpic" codePage="936"%>
    loadpic.aspx.csusing System;
    using System.Collections;
    using System.ComponentModel;
    using System.Data;
    using System.Data.SqlClient;
    using System.Drawing;
    using System.Drawing.Imaging;
    using System.Web;
    using System.Web.SessionState;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    using System.Web.UI.HtmlControls;
    using System.IO;using joyesDB.Security;namespace Wireless_Album
    {
    /// <summary>
    /// loadpic 的摘要说明。
    /// </summary>
    public class loadpic : System.Web.UI.Page
    {
    private void Page_Load(object sender, System.EventArgs e)
    {
    //const int MaxLength=150;  //最大长度
    //imgsrc();
    if (Request.QueryString["key"]==null || Request.QueryString["key"]==string.Empty)
    {
    Response.Redirect("index.aspx",true);
    }
    else
    {
    //取得原图
    string filename=Server.UrlDecode(Request.QueryString["key"]);
    Des sc=new Des();
    //Response.Write("<script>alert('"+filename +"');</script>");
    filename=sc.Decrypt(filename,"joyescom");
    //Response.Write("<script>document.write('"+filename +"');</script>");
    Bitmap bmpOld= new Bitmap(Server.MapPath(filename));
    Response.Clear();
    //输出图片
    bmpOld.Save(Response.OutputStream, ImageFormat.Jpeg);
    bmpOld.Dispose();
    Response.End();
    }
    } #region Web 窗体设计器生成的代码
    override protected void OnInit(EventArgs e)
    {
    //
    // CODEGEN: 该调用是 ASP.NET Web 窗体设计器所必需的。
    //
    InitializeComponent();
    base.OnInit(e);
    }

    /// <summary>
    /// 设计器支持所需的方法 - 不要使用代码编辑器修改
    /// 此方法的内容。
    /// </summary>
    private void InitializeComponent()
    {    
    this.Load += new System.EventHandler(this.Page_Load); }
    #endregion
    }
    }
    //两两前的代码...
    使用页面
    <img src="http://photo.joyes.com/loadpic.aspx?key=0B7BAAD210D2EB3E&s=big" alt="loading" />
    //这里的key由后台取出的实际地址 用des可逆算法加密效果可以看看 http://photo.joyes.com/loadpic.aspx?key=0B7BAAD210D2EB3E&s=big
      

  8.   

    但我认为每次都要创建Bitmap可能性能就将会有所下降啊!