📄 372.htm
字号:
<!-- saved from url=(0022)http://internet.e-mail -->
<html>
<head>
<title>作文件的CRC校验 </title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" href="inc.css">
</head>
<body bgcolor="#FFFFFF" text="#000000" link="#000000" vlink="195434" alink="195434">
<table width="621" border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td width="621"><a href="http://www.CoDelphi.com"><img src="images/logo.gif" border="0" width="153" height="60"><img src="images/bigbanner.gif" border="0" width="468" height="60"></a></td>
</tr>
</table><br>
<br>
<table width="621" border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td align="left" valign="top" class="font9" height="155">
<div align="center" class="btitle">作文件的CRC校验 <br>
<br>
</div>
<div align="center"><strong>Oliver Moenche </strong></div>
<b><br>
摘 要</b>:作文件的CRC校验 <br>
<b> 关键字</b>:文章 校验和 鉴别文件 crc <br>
<b> 类 别</b>:文件操作
<hr size="1" width="100%">
<span class="content"><br> 产生文件相关信息并不总是简单的。从文件中读取一定数量的字节也不很合适。因为对文件的修改不在读取的范围之内,这种方法是无效的。下面的程序不读取文件的内容,而是根据的文件的大小和日期时间。<br><br>function GenerateCheckSum (filename: string): int64; <br>var fdatetime, fsize: dword;<br> checksum: int64; <br>begin<br> checksum := (17 * fdatetime) div fsize;<br> checksum := checksum + ((8 * fdatetime) mod fsize);<br> checksum := checksum + abs((9 * fsize) - round(sqrt(fdatetime)));<br> checksum := 2 * checksum - (fsize + fdatetime);<br> GenerateCheckSum := checksum; <br>end; <br><br>这一例子中使用的算式是很简单的,你可以根据需要改变它们。<br><br>(该程序也能在Delphi 5以前的旧版Delphi中工作)</span>
<table border="0" cellspacing="0" cellpadding="1" class="font9" align="center" width="100%">
<tr align="left" valign="middle" bgcolor="195434">
<td height="1"></td>
</tr>
</table>
</td>
</tr>
<tr>
<td bgcolor="#C9C9C6" height="2"></td>
</tr>
</table>
<div align="center"><br>
中文开发在线<a href="http://www.codelphi.com" target="_blank">www.codelphi.com</a>授权使用。
</div>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -