堆栈溢出Userpic生成(标识) [英] Stack Overflow Userpic generation (Identicons)

查看:135
本文介绍了堆栈溢出Userpic生成(标识)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在C#ASP.NEt中创建一个网站,并希望使用类似于Stack Overflow的功能,
每次新用户在StackOverflow.com上注册时,都会为其分配一个默认用户图片,直到拥有一个gravatar,现在每张图片都不同于上一张,因此可以确定它是生成的,我想知道如何在C#中完成。

i an creating a website in C# ASP.NEt and want to use a feature similar to Stack Overflow, Every time a new user registers on the StackOverflow.com he is assigned a default user picture until he has a gravatar, Now every picture is different from the previous one, so it is sure it is generated, i want to know how can this be done in C#.

注意:(我不认为这是一个元问题,所以请不要将其移到那里。)

Note: (I don't think it is a meta question so please don't move it there)

推荐答案

它称为身份。它们是通过某种哈希生成的图像,通常是在用户名或电子邮件上生成的。

It's called Identicions. They are images generated by some kind of hash, usually on a username or email.

在Codeplex上有一个不错的开源库,用于生成Identicons。更多信息此处

There is a nice, open source library, on Codeplex for generating Identicons. More info here.

编辑:您实际上可以使用gravatar来生成Identicons 。构造这样的URL:

You can actually use gravatar to generate Identicons. Construct a URL like this:

http://www.gravatar.com/avatar/HASH_HERE?s=128&d=identicon&r=PG

这篇关于堆栈溢出Userpic生成(标识)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆