主题: asp.net文件管理图像无法显示缩略图
作者: 毅, 发布日期: 2010-05-19 23:28:59, 浏览数: 7121

网站环境:asp.net 2.0 + vs 2008

kindeditor版本:3.4.2

 

Managefile_json.cs文件代码如下:

 

using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Text;
using System.IO;

public partial class Managefile_json: System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        Response.Clear();
        Response.ContentType = "application/json;";
        Response.Charset = "UTF-8";
        string currentPath = "../../UploadFiles/";
        StringBuilder sb = new StringBuilder();
        sb.Append("{\"moveup_dir_path\":\"\",");
        sb.Append("\"current_dir_path\":\"" + currentPath + "\",");
        sb.Append("\"current_url\":\"" + currentPath + "\",");
        string[] files = System.IO.Directory.GetFiles(@Server.MapPath("" + currentPath));
        sb.Append("\"total_count\":" + files.Length + ",");
        sb.Append("\"file_list\":[");

        for (int i = 0; i < files.Length; i++)
        {
            FileInfo file = new FileInfo(files[i]);
            sb.Append("{\"is_dir\":false,\"has_file\":false,\"filesize\":" + file.Length + ",\"dir_path\":\"\",\"is_photo\":true,\"filetype\":\"" + file.Extension + "\",\"filename\":\"" + file.Name + "\",\"datetime\":\"" + file.CreationTime + "\"}");
            if (i != files.Length - 1)
            {
                sb.Append(",");
            }

        }
        sb.Append("]}");

        Response.Write(sb.ToString());
    }
}

 

故障:

打开网络文件夹后图像的缩略图一律是带×的图标,加载到kindeditor中也是带×的图标。

我在本机电脑上传这些图片都没有问题,上传时没有输入图像宽高等信息。

 

请大家给点提示,谢谢!

 

作者: Roddy, 发布日期: 2010-05-20 09:36:30

这是即将要发布的ASP.NET程序,请参考。

http://kindeditor.googlecode.com/svn/trunk/asp.net/

回复
作者: 毅, 发布日期: 2010-05-25 22:46:21

谢谢指导,下载最新源码,可以显示了

回复
发表新帖 发表回复