473,320 Members | 1,713 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,320 software developers and data experts.

File checksum

Hi,

Once I heard something about a files checksum. Is there a
smart way to verify to some degree that the content of a
file has not been changed in C#.

best regards Jesper.
Nov 15 '05 #1
3 7401
Hi,

You can compute a hash value (MD5 or SHA) on a file content, store it
somewhere and then re-compute the hash and compare to the stored value. If
they are not equal, the file has changed. .NET Framework has a built-in
implementation for hash computation in the System.Security.Cryptography
namespace.

--
Dmitriy Lapshin [C# / .NET MVP]
X-Unity Test Studio
http://x-unity.miik.com.ua/teststudio.aspx
Bring the power of unit testing to VS .NET IDE

"Jesper." <an*******@discussions.microsoft.com> wrote in message
news:05****************************@phx.gbl...
Hi,

Once I heard something about a files checksum. Is there a
smart way to verify to some degree that the content of a
file has not been changed in C#.

best regards Jesper.


Nov 15 '05 #2
Jesper. wrote:
Once I heard something about a files checksum. Is there a
smart way to verify to some degree that the content of a
file has not been changed in C#.


The recommended way is to use a CVS-System like (CVS, PVCS, SourceSafe,
ClearCase, ...)

--
Greetings
Jochen

Do you need a memory-leak finder ?
http://www.codeproject.com/tools/leakfinder.asp
Nov 15 '05 #3

Hash the file content.

To check for file modification:
Rehash the file content and compare to the above

<Linh Nguyen />
-----Original Message-----
Jesper. wrote:
Once I heard something about a files checksum. Is there a smart way to verify to some degree that the content of a file has not been changed in C#.
The recommended way is to use a CVS-System like (CVS,

PVCS, SourceSafe,ClearCase, ...)

--
Greetings
Jochen

Do you need a memory-leak finder ?
http://www.codeproject.com/tools/leakfinder.asp
.

Nov 15 '05 #4

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

Similar topics

2
by: Alejandrina | last post by:
Hi all, How can we calculate and send a checksum of a file we are uploading via HTML FORM? I suspect we cannot do it in JavaScript because it does not have access to the file for security...
2
by: pradeep | last post by:
I have 2 data files, DATA1 and DATA2 , both same. My task is to: Open DATA1, compute the checksum and put it in the end of the file(don't bother about boundary conditions).close DATA1 Open...
2
by: Abby | last post by:
I need to do 8 bits 2's complement checksum, so I wrote code in order to see if the checksum calculation is correct. ===========================================================================...
26
by: Michel Rouzic | last post by:
I have a binary file used to store the values of variables in order to use them again. I easily know whether the file exists or not, but the problem is, in case the program has been earlier...
24
by: pristo | last post by:
hello All, how can i insert unique ID into binary file (that created by compiler)? (so after compiling i can to identify the src that i use) thx
6
by: Chang | last post by:
How to get SHA1 or MD5 of a big file (+5MB - 20GB) as I can't read 20GB into memory. -- Chang.
1
by: xoinki | last post by:
hi experts, I need a little help in debugging this code.. would u pleeze kindly help me? here this program sends a datagram every 10 seconds and on reception it cheks whether the source IP is...
10
by: Andrew Robert | last post by:
Good evening, I need to generate checksums of a file, store the value in a variable, and pass it along for later comparison. The MD5 module would seem to do the trick but I'm sketchy on...
0
by: gajjar123 | last post by:
hi , i m trying to generate MD5 checksum (32 char) for xml file or other file using string Result ; Result=System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile(str,...
14
by: alexus | last post by:
Hello, I have bunch of video files, and I need somehow alternate them, and by that I mean so check sum would be different, yet won't break content of video itself. any ideas?
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
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...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.