private void Page_Load(object sender, System.EventArgs e)
{
WindowsPrincipal p = Thread.CurrentPrincipal as WindowsPrincipal;
Response.Write(p.Identity.Name)
}
跟web.config还是iis设置有关么?
{
WindowsPrincipal p = Thread.CurrentPrincipal as WindowsPrincipal;
Response.Write(p.Identity.Name)
}
跟web.config还是iis设置有关么?
解决方案 »
- ASP.NET邮件问题
- 关于使用comet长连接的问题
- 怎样再后台 得到 动态生成的DIV(JS生成的)的 各种属性,在线等
- 怎样将DataTable作为UpDate的参数(asp2.0)在线等高手回答
- 为什么部署Enterprise Library时会出现写注册表错误的?为什么要InstallUtil.exe来解决的?(详细见内容)
- 【做过粮食系统的兄弟姐妹们进来瞅瞅】
- AppCode文件夹的问题
- 我急的哭~~~大家帮帮我
- 用c#在IIS上建立了一个web站点,但是不能在站点下运行asp.net文件,显示无法找到网页,
- 在asp.net用file field控件,怎样把路径与文件名赋给变量,急!!!!!!!!!!!!!
- 用VB.Net做ASP页面还非要用javascript?
- 小问题
private void Page_Load(object sender, System.EventArgs e)
{
Response.Write(System.Threading.Thread.CurrentPrincipal.GetType().Name);
//System.Security.Principal.WindowsPrincipal p = System.Threading.Thread.CurrentPrincipal as System.Security.Principal.WindowsPrincipal;
System.Security.Principal.WindowsIdentity w= System.Security.Principal.WindowsIdentity.GetCurrent();
if (w != null)
Response.Write(w.Name);
}</script>
我好像见过用DirectoryEntry的,可以实现么?
http://www.devx.com/SummitDays/Article/6666
<forms loginUrl="login.aspx" />
using System.Web.Security;
using System.Configuration;Context.User.Identity.Name
另外问一下,集成Windows验证的验证规则是什么?
应该可以的啊“集成Windows验证的验证规则”怎么理解?有关Windows认证方式,请参看一下这篇文章:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpconthewindowsauthenticationprovider.asp
我的怎么不可以啊,可否提供一下详细代码?
http://www.renwen.net/Article_Show.asp?ArticleID=820
或者这个,有示例代码:
http://www.dotnetbips.com/displayarticle.aspx?id=10