473,383 Members | 1,795 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

Check File Integrity

Hi,

Anybody knows how to check the file integrity?

I need to check the file integrity whether it is corrupt or not. Can
anyone please advice?

Feb 8 '07 #1
1 7047
Once the file is created and you know it is good, create an MD5 hash
of it. Then, in the future, you can create another MD5 hash and
compare the value to the original. If one BIT is different you will
get a different hash.

Here is a routine that will give you the MD5 hash of a file.

public string Compute_MD5Hash_FromFile(string FileNameAndPath)
{
using (FileStream fs = new FileStream(FileNameAndPath,
FileMode.Open))
{
return Convert.ToBase64String(new
MD5CryptoServiceProvider().ComputeHash(fs));
}
}
http://www.codershangout.com

On Feb 8, 7:39 am, giftson.j...@gmail.com wrote:
Hi,

Anybody knows how to check the file integrity?

I need to check the file integrity whether it is corrupt or not. Can
anyone please advice?

Feb 8 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Dmitri Shvetsov | last post by:
Hi, What methods can we use to check the integrity problems? Some records in my database are having Foreign Keys but the database doesn't have any related records with required Primary Keys. I...
3
by: RAD | last post by:
I am working with an evaluation copy of SQL Server 2000 for the first time; my DB experience lies with MS Access. I have a simple table in SQL Server (tblCompany) that has a field called...
2
by: Brice | last post by:
Hello, Sorry if this is a basic question but I can't seem to find the answer in the DB2 tutorial series or my DB2 manuals. How does one check the data integrity and referential integrity of an...
60
by: Julie | last post by:
What is the *fastest* way in .NET to search large on-disk text files (100+ MB) for a given string. The files are unindexed and unsorted, and for the purposes of my immediate requirements, can't...
3
by: Stephen | last post by:
This is probably something simple but I've been trying for a while now and can't seem to get it. I'm loading a table from an IXF file with the following command 'load from...
1
by: huyuhui | last post by:
The following is a question of LOAD utility. Question: How does the DB2 enforce table check constraints for data added to table with the LOAD utility? A. With the BUILD phase of LOAD B. With the...
16
by: Brian Tkatch | last post by:
Is there a way to check the order in which SET INTEGRITY needs to be applied? This would be for a script with a dynamic list of TABLEs. B.
6
by: Hemant Shah | last post by:
Folks, One of our clients is performing an audit, and the auditor(s) asked following question, and I am not sure how to answer it: 28. Is there a control that prevents the corruption of...
1
by: amitabh.mehra | last post by:
If I drop some constraints on a table by 'alter table..' query, does this table go into check pending state? If no, then what is the way to put this table into check pending state other than using ...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.