如何使用C#和asp.net来创建用户名子? [英] How to create subdomain with username using C# and asp.net?
问题描述
当用户与我的网站注册时,他们会得到这样的http://username.mysite.com以访问网页/文件夹的URL。这怎么可能使用C#和asp.net mvc的。
When a user registers with my site, they will get a url like this "http://username.mysite.com" to access their page/folder. How this is possible using C# and asp.net mvc.
任何帮助是AP preciated。
Any help is appreciated.
推荐答案
我也希望实现你的情况,并有书签一些联系。也许这将让你对你的方式,直到一些SO巨星给出了另一个完整的样本;)
I was also looking to implementing your scenario and have some links bookmarked. Maybe this will get you on your way until some SO superstar gives another complete sample ;)
http://blogs.securancy.com/post/ASPNET- MVC-子域,Routing.aspx
- 第1步:自定义RouteBase
- 第2步:创建控制器
- 第3步:注册路线
- 第4步:在本地主机上IIS子域
在文章的最后,还引用了另一个SO后:
At the end of the article, it also references another SO post:
<一个href=\"http://stackoverflow.com/questions/278668/is-it-possible-to-make-an-asp-net-mvc-route-based-on-a-subdomain\">http://stackoverflow.com/questions/278668/is-it-possible-to-make-an-asp-net-mvc-route-based-on-a-subdomain
这似乎是一个超级巨星SO已经回答了这个问题:)
It seems like a SO superstar has already answered the question :)
这篇关于如何使用C#和asp.net来创建用户名子?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!