问题描述
我存jpg,ico,rar...都可以存入,而且都可以区分开0xFFD8FFE000104A46494600010101000000000000FFDB00430006040506050406060506070706080A100A0A09090A140E0F0C1017141818171416161A1D251F1A1B31C1616202C20232627292A29191F2D302D283025282928FFDB0043010707070A080A1300A0A13281A161A282828282828282828282828282828282828280xFFD8FFE000104A46494600010201004800480000FFE10C654578696600004D4D002A000000080007011200030000000100010000011A00050000000100000062011B0005000000010000006A012800030000000100020000013100020000001B0000007201320002000000140000008D8769000400000001000000A40000000x000001000500808000000100200028080100560000006060000001002000A89400007E080100404000000100200028420000269D01003030000001002000A82500004EDF01002020000001002000A8100000F604020028000000800000000001000001002000000000000000010000000000000000000000000000000000CF但是.exe和.dll存入后用select*from...查询image对应字段的数据都是一样的都是下边这个数据0x4D5A90000300000004000000FFFF0000B800000000000000400000000000000000000000000000000000000000000000000000000000000000000000800000000E1FBA0E00B409CD21B8014CCD21546869732070726F6772616D2063616E6E6F742062652072756E20696E20444F53206D6F64652E0D0D0A24000000000000Byte[]passphoto=null;if(this.strFilePath!=null){FileStreamfs=newFileStream(strFilePath,FileMode.Open,FileAccess.Read);byte[]file=newbyte[fs.Length];fs.Read(file,0,(int)fs.Length);passphoto=file;}SqlCommandobjComm=newSqlCommand("insertintoProgram_Info(Program_File)values(@Program_File)",sqlconn);objComm.Parameters.Add("@Program_File",passphoto);实在没有办法了,帮帮我吧,谢谢了
解决方案
解决方案二:
EXEDLL都是PE格式的文件,只有在DOS头和DOSstub后的PE才能区分
解决方案三:
在存入时用一个字段保存文件类型或文件名。
解决方案四:
同意2楼,另外楼主有没有试验过音频视频文件的插入问题?