本文介绍了ASP.NET子域重定向的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
大家好,
我有一个asp.net应用程序来管理员工的详细信息。通过单击一个发布详细信息按钮,我想将详细信息复制到子域employee.domainName.com/employeeName/。如何在visual studio中设置此子域以及URL重定向如何?请详细说明。
提前致谢,
Manu v nath
Hi all,
I have an asp.net application to manage employee details. By clicking one 'publish details' button I want to copy details into sub domain 'employee.domainName.com/employeeName/'. How to setup this sub domain in visual studio and how about URL redirect? Please explain in detail.
Thanks in advance,
Manu v nath
推荐答案
string metabasePath = "IIS://" + server.ComputerName + "/W3SVC";
DirectoryEntry w3svc = new DirectoryEntry(metabasePath, server.Username, server.Password);
string serverBindings = ":80:" + site.HostName;
string homeDirectory = server.WWWRootPath + "\\" + site.FolderName;
object[] newSite = new object[] { site.Name, new object[] { serverBindings }, homeDirectory };
object websiteId = (object)w3svc.Invoke("CreateNewSite", newSite);
// Returns the Website ID from the Metabase
int id = (int)websiteId;
问候,
Praveen
Regards,
Praveen
这篇关于ASP.NET子域重定向的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!