如何使用Windows帐户编写门户网页登录另一个Windows身份验证网站 [英] how to write a portal webpage using windows account to log in another windows authentication web station
问题描述
我们有一个巨大的asp网站项目,使用Windows身份验证登录和管理
操作权限。众所周知,IIS和web.config使用windows设置
身份验证,当登录到网页时,弹出默认的Windows登录对话框
。但是ou 客户讨厌默认的Windows登录对话框,并希望我使用Windows帐户写一个
门户网页登录该asp网站。我不能写asp
程序,只能编写asp.net和C#程序,我该怎么办?
We have a huge asp web station project using windows authentication to login and manage the
operation authority .As we all known ,IIS and web.config were setted using windows
authentication ,and when logged into the web page ,default windows login dialog box will
popped up. But our customer hate default windows login dialog box and want me to write a
portal webpage using windows account to log in that asp web station . I cannot write asp
programs ,and only can write asp.net and C# programs,and how can I do it?
推荐答案
下面的代码只有在传递正确的用户名和密码的情况下才会起作用,否则将返回错误
<%
设置adObject = GetObject(WinNT:)
设置userObject = adObject.OpenDSObject(WinNT://&domainName,userName,password,ADS_SECURE_AUTHENTICATION)
%>
The below code will work only in case proper username & password is passed else error will be returned
<%
Set adObject = GetObject("WinNT:")
Set userObject = adObject.OpenDSObject("WinNT://" & domainName, userName, password, ADS_SECURE_AUTHENTICATION)
%>
这篇关于如何使用Windows帐户编写门户网页登录另一个Windows身份验证网站的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!