Retrieving file MD5 values with ASP

Source: Internet
Author: User
Tags md5 md5 encryption


Online ASP Encryption characters MD5 many, but also very common, but the file MD5 is indeed very few, because of the ASP language itself limitations. We know that the MD5 of strings can be used for irreversible encryption of plaintext, which guarantees the security of data storage or transmission. Similarly, the file for MD5 encryption is also to ensure that when the network is not modified and verify the transmission, there is another use in the personal site inside the application: You can ensure that the uploaded pictures or files are unique. Principle is that upload to the server, while in the database record the MD5 value of the uploaded file, so that the next time to pass the same file, you can query whether the database is the same file, MD5 the same value, we think it is the same file, MD5 value is the file "id", In fact, Baidu also has this application, in Baidu Search pictures, click on the picture, sometimes will appear "You can also click the following link to see this picture: XXX url", the principle is the same, the file for MD5.



Cut the crap, start the text.



ASP is called by XML interactively. NET program implementation file MD5



ASP due to the limitations of its own language, can not achieve the file MD5, but. NET can, that is not through. NET to the file to MD5, and then send information to the ASP to receive, so you can do the MD5 of the ASP, the answer is yes. This involves the interaction between ASP and. NET programs, I have written an ASP's class: "ASP processing XML data send, Receive class", you can on my Baidu space to see: http://hi.baidu.com/manbutianmi/blog/item/ dec182fc6db36587b801a0f6.html, the ASP processing XML data send and receive, can be used in various heterogeneous systems between the API interface communication. This article is just one application of this class. The code is as follows:



ASP-Side code



Xmlcls.asp



<%



Rem processing the sending and receiving classes of XML data



'--------------------------------------------------



' You must keep this copyright information when you reprint it.



' Author: Walkman



' URL: Mobile theme network: http://www.shouji138.com



' Version: ver1.0



'--------------------------------------------------



Class Xmlclass



Rem variable definition


Private XmlDoc,XmlHttp
Private MessageCode,SysKey,XmlPath
Private m_GetXmlDoc,m_url
Private m_XmlDocAccept



Rem initialization


Private Sub Class_Initialize()
 On Error Resume Next
 MessageCode = ""
 XmlPath = ""
 Set XmlDoc = Server.CreateObject("msxml2.FreeThreadedDOMDocument.3.0")
 XmlDoc.ASYNC = False
End Sub


Rem Destroy Object


Private Sub Class_Terminate()
 If IsObject(XmlDoc) Then Set XmlDoc = Nothing
 If IsObject(m_XmlDocAccept) Then Set m_XmlDocAccept = Nothing
 If IsObject(m_GetXmlDoc) Then Set m_GetXmlDoc = Nothing 
End Sub


Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.