|
-
Jul 5th, 2009, 08:30 AM
#4
Re: New to C#, File Check
I would suggest that you use an FtpWebRequest with the Method set to GetDateTimeStamp. You can then compare that to the value for the last file you retrieved.
If you really do want to download the file first then you can use WebClient.DownloadFile. In order to compare the file to see if its contents have changed I would suggest that you create an MD5 hash. If it's different to the value for the last file then the contents have changed. Given that you need to create a Byte array from the file to create the hash, you might want to call DownloadData instead of DownloadFile. DownloadData returns a Byte array directly, so if the data hasn't changed you wouldn't bother saving a file at all.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|