How can I compute MD5 in a Metro Style app that is written in C#?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
There is lots of information on the locations of various namespaces for Metro at the Metro style app reference.
I'm not sure about MD5, but the the hashing stuff for SHA is in Windows.Security.Cryptography.Certificates
Obviously we don't know if you really need MD5, but if you don't (i.e. you're not talking to something else that expects MD5) then don't - it's often the go-to hashing for people just because it's more famous, but others are often better for all sorts of reasons.
回答2:
Check out the documentation, apparently this ends up in a Windows namespace. I suspect the HashAlgorithmProvider does what you need, but I couldn't test yet.