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
查看全文
相关阅读:
iOS 6编程UIScrollView滚动视图结合UIImageView图像视图实现图像缩放效果
iOS 6编程UIScrollView滚动视图和UIPageControl分页控件实现图像分页显示(2)
iOS 6编程基于AV Foundation框架开发简单音乐播放器
iOS 6 的5个新特性创建杀手级应用
mysql数据库备份和还原
SEO实战:解决百度收录问题
nginx的80端口配置两个Web服务
DedeCMS, Discuz, Phpwind, PhpCMS
nginx下安装wordpress
larbin编译和配置
原文地址:https://www.cnblogs.com/supercode/p/173340.html
最新文章
深圳科技图书馆一年
静态库 动态库
OpenGL_ES1.1在wince6.0的初始化。
水晶报表打印
source命令(转载)
MAC下修改终端为vi模式
mac下profile文件(转载)
Ubuntu 12.04安装Google Chrome(转载)
在Unity中不显示挂载的NTFS磁盘
整数的所有不同分割数目2013年2月15日
热门文章
busybox源码剖析(1)whoami.c
MAC下安装nginx(转载)
Mac Terminal Disable Beep(转载)
Ubuntu 12.04安装Ubuntu Tweak 0.7.0指南(转载)
iOS 6编程音频播放使用MPMusicPlayerController 还是 AVAudioPlayer呢?
ObjectiveC 实现类中Continuation Category或Class Extension
3种方法快速制作tpk文件
iOS 6 开发开发定位服务的App在地图上标注位置
ArcGIS for Android 支持模拟器开发
iOS 6编程UIScrollView滚动视图和UIPageControl分页控件实现图像分页显示
Copyright © 2011-2022 走看看