zoukankan
html css js c++ java
文件类型的判断
public
bool
isExeDllFile(
string
sFileName)
{
bool
xx
=
false
;
//
default the "sFileName" is not a .exe or .dll file;
FileStream fs
=
new
FileStream(sFileName, FileMode.Open, FileAccess.Read);
BinaryReader r
=
new
BinaryReader(fs);
string
bx
=
""
;
byte
buffer;
try
{
buffer
=
r.ReadByte();
bx
=
buffer.ToString();
buffer
=
r.ReadByte();
bx
=
bx
+
buffer.ToString();
}
catch
{
}
r.Close();
fs.Close();
if
(bx
==
"
7790
"
||
bx
==
"
8297
"
||
bx
==
"
8075
"
)
//
7790:exe 8297:rar 8075:pk
{
xx
=
true
;
}
return
xx;
}
dll:MZ
exe:MZ
rar:Rar
zip:PK
查看全文
相关阅读:
CCF CSP 201609-2 火车购票
CCF CSP 201409-2 画图
CCF CSP 201409-2 画图
CCF CSP 201409-4 最优配餐
CCF CSP 201409-4 最优配餐
CCF CSP 201503-1 图像旋转
CCF CSP 201503-1 图像旋转
Ethical Hacking
Ethical Hacking
Ethical Hacking
原文地址:https://www.cnblogs.com/supercode/p/173340.html
最新文章
获取应用程序的日志信息
获取安全日志信息
获取系统日志信息
判断当前用户的权限
获取当前登录用户
获取映射驱动器路径
实现输出大小写字母
head first 设计模式笔记1-策略模式:模拟鸭子
定时任务spring task
shiro之缓存
热门文章
SpringBoot2.0集成Shiro
Apache Shiro
shiro-redis实现session存储到redis
mysql Too many connections
druid配置以及监控
POI操作Excel(批量导出数据/下载excel)
状态管理-vuex
CCF CSP 201409-5 拼图
CCF CSP 201409-5 拼图
CCF CSP 201609-2 火车购票
Copyright © 2011-2022 走看看