高手来 如何用代码判断 上传图片 是否被ps或其他处理工具处理过 谢谢了

解决方案 »

  1.   


    // 如果你是FileUpload控件上传得
    Byte[] buffer = FileUpload1.FileBytes;
    string str = buffer[4869].ToString(); //A 65
    str += buffer[4870].ToString();//d 100
    str += buffer[4871].ToString();//o 111
    str += buffer[4872].ToString();//b 98
    str += buffer[4873].ToString();//e 101
    str += buffer[4874].ToString();//  32
    str += buffer[4875].ToString();//P 80
    str += buffer[4876].ToString();//h 104
    str += buffer[4877].ToString();//o 111
    str += buffer[4878].ToString();//t 116
    str += buffer[4879].ToString();//o 111
    str += buffer[4880].ToString();//s 115
    str += buffer[4881].ToString();//h 104
    str += buffer[4882].ToString();//o 111
    str += buffer[4883].ToString();//p 112
    if (str == "65100111981013280104111116111115104111112")
    {
    // PS处理过
    }"65100111981013280104111116111115104111112"的意思是“Adobe Photoshop”
    PS处理过的文件会在第1305字节写入Adobe Photoshop CS2 Windows信息
    你这样获得到字节的信息,看字节里有没有“Adobe Photoshop”,有的话就说明图片是PS过的。现在一般用的就是这个方法