// If you are using the fileupload control
Byte [] buffer = fileupload1.filebytes;
String STR = buffer [2, 4869]. tostring (); // a 65
STR + = buffer [1, 4870]. tostring (); // D 100
STR + = buffer [4871]. tostring (); // o 111
STR + = buffer [4872]. tostring (); // B 98
STR + = buffer [1, 4873]. tostring (); // E 101
STR + = buffer [4874]. tostring (); // 32
STR + = buffer [4875]. tostring (); // P 80
STR + = buffer [1, 4876]. tostring (); // H 104
STR + = buffer [4877]. tostring (); // o 111
STR + = buffer [1, 4878]. tostring (); // t 116
STR + = buffer [4879]. tostring (); // o 111
STR + = buffer [4880]. tostring (); // s 115
STR + = buffer [1, 4881]. tostring (); // H 104
STR + = buffer [4882]. tostring (); // o 111
STR + = buffer [1, 4883]. tostring (); // P 112
If (STR = "65100111981013280104111116111115104111112 ")
{
// Psprocessed
}
"65100111981013280104111116111115104111112" means "Adobe Photoshop"
Files processed by pswrite Adobe Photoshop CS2 windows information in 1,305th bytes.
In this way, you can get the byte information to see if there is any "Adobe Photoshop" in the byte. If yes, the image is ps.
This method is usually used now.