一个图片站,用户要点数来看图.
怎样防止用户用flashget等工具或知道真图的路径后直接打图的网址看,
请帮说一个解决方案,谢谢!
------解决方案--------------------------------------------------------
UP 学习
------解决方案--------------------------------------------------------
这个 需要你
把真实的 图片地址隐藏掉
使用一个专门的 loadpic.aspx文件 来 读取真实图片
并输出
在这个文件里面 即可判断用户权限.
------解决方案--------------------------------------------------------
同意楼上的!
------解决方案--------------------------------------------------------
可把图片放在虚拟目录之外的地方.用一个专门的页面.判断权限后通过writeFile的方式输出.
------解决方案--------------------------------------------------------
use httphandler
------解决方案--------------------------------------------------------
io即时输出用户浏览
------解决方案--------------------------------------------------------
mark
------解决方案--------------------------------------------------------
用HttpModule过滤请求,例如你用Forms验证的话就用同样的验证来过滤请求。
------解决方案--------------------------------------------------------
你在webconfig文件里设置下不允许匿名用户浏览不就可以了.
------解决方案--------------------------------------------------------
图片放在虚拟目录之外的地方.用一个专门的页面判断权限后输出
------解决方案--------------------------------------------------------
在以前公司时候做的
可以实现楼主需要
loadpic.aspx
<%@ Page language= "c# " Codebehind= "loadpic.aspx.cs " AutoEventWireup= "false " Inherits= "Wireless_Album.loadpic " codePage= "936 "%>
loadpic.aspx.cs
using 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);