站内提供下载的文件,如何只让登陆的用户才能有下载权呢?
并且真正的文件路径也不让用户看到..高手指教!!

解决方案 »

  1.   

    first use session,second disable right click,and user can only save files for left click
      

  2.   

    http://www.gotocode.com/disc_viewt.asp?mid=8358&s_topic=re&
      

  3.   

    1.判断上一页来源.和当前连接是否为本站.2.判断session是否为空.3.在客户登陆的时候设置cookie..确定用户身份...
      

  4.   

    回复人: bingbingcha(不思不归,不孟不E,原来是头大灰狼) 能详细讲下吗?给点CODE看看可以不?
      

  5.   

    显示下载链接时判断用户有没有登录!!
    ASPX文件:
    <asp:DataList id="DataList2" runat="server" Width="460" RepeatDirection="Horizontal" RepeatColumns="10">
    <ItemTemplate>
    <a  class="login2" href="javascript:<%#CheckRight((DataBinder.Eval(Container.DataItem, "SegmentUrl")).ToString())%>">
    <%# DataBinder.Eval(Container.DataItem, "SegmentName")%></a>
    </ItemTemplate>
    </asp:DataList>
    CS文件:public string  CheckRight(string downurl)
    {
         if (Session["UserID"] !=null) 
         {
              return "window.location='"+downurl+"';";
          }
    else   return "if(confirm('尊敬的用户,您还未登陆系统')) {window.location='MediaInfo.aspx';}";
      

  6.   

    回复人: gyf19(秋天的云) ( ) 
    代码好像不行吧..
    href="javascript:<%#CheckRight((DataBinder.Eval(Container.DataItem, "SegmentUrl")).ToString())%>">
    说这里有错哦.而且
    "window.location='"+downurl+"';";
    中有我的URL在.以后用户不登陆用FLASHGET下载那样的话问题是没有解决到啊
      

  7.   

    下面这个是我下午回复过的一个关于下载的帖子:http://community.csdn.net/Expert/topic/4287/4287094.xml?temp=.0517084你只要在它的方法的第一句判断用户登录信息和待下载的文件的下载权限就可以了。
      

  8.   

    你可以把所有要下载的文件地址都保存到数据库里面。然后所有需要下载的地方,调用download.aspx?id=0001来下载真正的文件。
    在download.aspx中,首先进行权限判断,是否是合法用户,如果是,则从数据库中取出0001对应的真正文件下载地址,输出给客户端就可以了。
      

  9.   

    <%
        Dim strPicName    strFilename = "f:\temp\" & request("file") Response.Buffer = True
    Response.Clear

    Set s = Server.CreateObject("ADODB.Stream")
    s.Open

    s.Type = 1

    on error resume next

    Set fso = Server.CreateObject("Scripting.FileSystemObject")
    if not fso.FileExists(strFilename) then
    Response.Write("<h1>Error:</h1>" & strFilename & " does not exist<p>")
    Response.End
    end if


    Set f = fso.GetFile(strFilename)
    intFilelength = f.size


    s.LoadFromFile(strFilename)
    if err then
    Response.Write("<h1>Error: </h1>" & err.Description & "<p>")
    Response.End
    end if Response.Clear()
    response.contenttype="image/gif"
    response.BinaryWrite s.Read 'Response.AddHeader "Content-Disposition", "attachment; filename=" & f.name
    'Response.AddHeader "Content-Length", intFilelength
    'Response.CharSet = "UTF-8"
    'Response.ContentType = "application/octet-stream"

    'Response.BinaryWrite s.Read
    'Response.Flush

    s.Close
    Set s = Nothing

    %>
      

  10.   

    <img src="HideImg.asp?file=1.gif" border="0">
    <img src="HideImg.asp?file=浙江地图.jpg" border="0">
      

  11.   

    再用session或.net的认证机制判断