ASP.NET与计算机域的问题..请知道进来看下 本帖最后由 hya0114145 于 2011-01-05 16:07:01 编辑 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 但是装IIS的电脑和装域的电脑不是一台电脑网站是如何发送请求给装域的电脑.. 这是另一个问题..而且你需要一个有权限的用户权限来判断输入的用户是否有权限..因为网站都是匿名访问..客户又不想windows集成验证..所有才想到把信息发送到安装域的电脑上来判断所有就产生一个问题..asp.net是如何发送信息给安装域的电脑 他说通过ldap的协议什么的.. IIS可以调用域服务器进行验证using System;using System.Data;using System.Configuration;using System.Web;using System.Security;using System.DirectoryServices;using System.Text;string domain="你的域名";string username="域用户名";string pwd = "口令";string _path="LDAP://"+domain;string domainAndUsername = domain + @"\" + username; DirectoryEntry entry = new DirectoryEntry(_path, domainAndUsername, pwd); DataTable dt = new DataTable(); try { //Bind to the native AdsObject to force authentication. object obj = entry.NativeObject; DirectorySearcher search = new DirectorySearcher(entry); search.Filter = "(SAMAccountName=" + username + ")"; //search.PropertiesToLoad.Add("cn"); search.PropertiesToLoad.AddRange(new String[] { "cn", "sAMAccountName", "displayName", "department", "title", "mail", "telephoneNumber" }); SearchResult result = search.FindOne(); string a = (string)result.Properties["cn"][0]; string b = (string)result.Properties["sAMAccountName"][0]; string c = (string)result.Properties["displayName"][0]; //string d = (string)result.Properties["department"][0]; string e = (string)result.Properties["title"][0]; string f = (string)result.Properties["mail"][0]; string g = (string)result.Properties["telephoneNumber"][0]; dt.Columns.Add("Login", typeof(string)); dt.Columns.Add("FullName", typeof(string)); dt.Columns.Add("Department", typeof(string)); dt.Columns.Add("Duty", typeof(string)); dt.Columns.Add("Email", typeof(string)); dt.Columns.Add("Phone", typeof(string)); DataRow dr = dt.NewRow(); dr["Login"] = b; dr["FullName"] = c; dr["Department"] = ""; dr["Duty"] = e; dr["Email"] = f; dr["Phone"] = g; dt.Rows.Add(dr); if (null == result) { //return false; return dt; } //Update the new path to the user in the directory. _path = result.Path; //result.GetDirectoryEntry(entry).Properties["cn"].Values; //_filterAttribute= (string)result.Properties["cn"][0]; } catch (Exception ex) { throw new Exception(ex.Message); } if(dt.Rows.Count>0) { //是域用户 } else { //不是域用户 } //dt的列有可能会是空(你不需要这么多列),你自己注意下,因为建立域账号的时候不一定信息都填全了 string _path="LDAP://"+domain;string domainAndUsername = domain + @"\" + username;DirectoryEntry entry = new DirectoryEntry(_path, domainAndUsername, pwd);WinNT * 连接到计算机上的组。例如“WinNT://<域名>/<计算机名>/<组名>”。如果是连接到本地计算机,则为“WinNT://<计算机名>/<组名>”。 * 连接到计算机上的用户。例如“WinNT://<域名>/<计算机名>/<用户名>”。如果是连接到本地计算机,则为“WinNT://<计算机名>/<用户名>”。 * 连接到计算机上的服务。例如“WinNT://<域名>/<计算机名>/<服务名>”。如果是连接到本地计算机,则为“WinNT://<计算机名>/<服务名>”。 * 发现网络上的所有域。例如,“WinNT:”通过枚举此项的子级可以找到这些域。LDAP * 连接到域中的组。例如“LDAP://CN=<组名>, CN =<用户>, DC=<域组件>, DC=<域组件>,...”。 * 连接到域中的用户。例如“LDAP://CN=<完整用户名>, CN=<用户>, DC=<域组件>, DC=<域组件>,...”。 * 连接到域中的计算机。例如“LDAP://CN=<计算机名>, CN=<计算机>, DC=<域组件>, DC=<域组件>,...”。上面的代码不对吧...LDAP:后面的字符串不对 asp.net程序调试出现乱码 还望高手指点,谢天谢地,谢高手。。。 服务器超时问题。在线等 dhtmlxVault 上传图片大小变大,图片变花 ajax 无刷新跳转后台,但是不更新数据 是为哪样啊? 请教,在ASP.NET (VB.NET)页面中如何调用之前ASP中用的UBB代码,有没有实例? 不用IIS还能用什么服务器? 如何获取表头的值啊,我的DataGrid是从excel的数据动态生成的,现在我要第一行的数据用来做字段名,写入数据库 求多Grid实现用户控件 关于.net调试时的灾难性错误,急!!! 很郁闷很郁闷的一个关于IIS的问题. 请问一下怎么在母版页面中用JS转页?
网站是如何发送请求给装域的电脑..
客户又不想windows集成验证..所有才想到把信息发送到安装域的电脑上来判断
所有就产生一个问题..asp.net是如何发送信息给安装域的电脑
他说通过ldap的协议什么的..
IIS可以调用域服务器进行验证using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Security;
using System.DirectoryServices;
using System.Text;string domain="你的域名";
string username="域用户名";
string pwd = "口令";
string _path="LDAP://"+domain;
string domainAndUsername = domain + @"\" + username;
DirectoryEntry entry = new DirectoryEntry(_path, domainAndUsername, pwd);
DataTable dt = new DataTable(); try
{
//Bind to the native AdsObject to force authentication.
object obj = entry.NativeObject; DirectorySearcher search = new DirectorySearcher(entry); search.Filter = "(SAMAccountName=" + username + ")";
//search.PropertiesToLoad.Add("cn");
search.PropertiesToLoad.AddRange(new String[] { "cn", "sAMAccountName", "displayName", "department", "title", "mail", "telephoneNumber" });
SearchResult result = search.FindOne(); string a = (string)result.Properties["cn"][0];
string b = (string)result.Properties["sAMAccountName"][0];
string c = (string)result.Properties["displayName"][0];
//string d = (string)result.Properties["department"][0];
string e = (string)result.Properties["title"][0];
string f = (string)result.Properties["mail"][0];
string g = (string)result.Properties["telephoneNumber"][0];
dt.Columns.Add("Login", typeof(string));
dt.Columns.Add("FullName", typeof(string));
dt.Columns.Add("Department", typeof(string));
dt.Columns.Add("Duty", typeof(string));
dt.Columns.Add("Email", typeof(string));
dt.Columns.Add("Phone", typeof(string)); DataRow dr = dt.NewRow();
dr["Login"] = b;
dr["FullName"] = c;
dr["Department"] = "";
dr["Duty"] = e;
dr["Email"] = f;
dr["Phone"] = g;
dt.Rows.Add(dr); if (null == result)
{
//return false;
return dt;
} //Update the new path to the user in the directory.
_path = result.Path;
//result.GetDirectoryEntry(entry).Properties["cn"].Values;
//_filterAttribute= (string)result.Properties["cn"][0];
}
catch (Exception ex)
{
throw new Exception(ex.Message);
} if(dt.Rows.Count>0)
{
//是域用户
}
else
{
//不是域用户
}
//dt的列有可能会是空(你不需要这么多列),你自己注意下,因为建立域账号的时候不一定信息都填全了
string domainAndUsername = domain + @"\" + username;
DirectoryEntry entry = new DirectoryEntry(_path, domainAndUsername, pwd);WinNT * 连接到计算机上的组。例如“WinNT://<域名>/<计算机名>/<组名>”。如果是连接到本地计算机,则为“WinNT://<计算机名>/<组名>”。
* 连接到计算机上的用户。例如“WinNT://<域名>/<计算机名>/<用户名>”。如果是连接到本地计算机,则为“WinNT://<计算机名>/<用户名>”。
* 连接到计算机上的服务。例如“WinNT://<域名>/<计算机名>/<服务名>”。如果是连接到本地计算机,则为“WinNT://<计算机名>/<服务名>”。
* 发现网络上的所有域。例如,“WinNT:”通过枚举此项的子级可以找到这些域。LDAP * 连接到域中的组。例如“LDAP://CN=<组名>, CN =<用户>, DC=<域组件>, DC=<域组件>,...”。
* 连接到域中的用户。例如“LDAP://CN=<完整用户名>, CN=<用户>, DC=<域组件>, DC=<域组件>,...”。
* 连接到域中的计算机。例如“LDAP://CN=<计算机名>, CN=<计算机>, DC=<域组件>, DC=<域组件>,...”。上面的代码不对吧...LDAP:后面的字符串不对