Click here to Skip to main content
15,905,232 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: how to save word document to sql server ? Pin
enjoycrack19-Apr-06 0:39
enjoycrack19-Apr-06 0:39 
QuestionHow to get data Pin
papa198018-Apr-06 23:38
papa198018-Apr-06 23:38 
AnswerRe: How to get data Pin
DotNetDominator19-Apr-06 4:27
DotNetDominator19-Apr-06 4:27 
QuestionHow to get data from drop down list Pin
papa198018-Apr-06 23:36
papa198018-Apr-06 23:36 
QuestionPOP3 Mail Server Pin
SR Ranjini18-Apr-06 23:35
SR Ranjini18-Apr-06 23:35 
AnswerRe: POP3 Mail Server Pin
enjoycrack19-Apr-06 0:56
enjoycrack19-Apr-06 0:56 
QuestionAuthenticatinf a user through Active directory Pin
sandeep kumar pundhir18-Apr-06 22:41
sandeep kumar pundhir18-Apr-06 22:41 
AnswerRe: Authenticatinf a user through Active directory Pin
colin mcadam19-Apr-06 0:09
colin mcadam19-Apr-06 0:09 
I done this a few months ago and used this code.
I'm not sure if it is the most efficient but it works for me.

A couple of things to watch for;
remember to turn off anonymous authentication in iis and edit the web.config as in comments

// Get users windows login username<br />
			// need to set anonymous authentication off in IIS and add the line <identity impersonate="true" /> to web.config<br />
			string strUname = System.Security.Principal.WindowsIdentity.GetCurrent().Name.ToString();<br />
                        //remove the domain name qualifier which is 9 chars for my domain<br />
			strUname = strUname.Substring(9,strUname.Length - 9);<br />
			// boolean variable to hold the result of the group comparison between the users group and the group specified<br />
			Boolean bIsAuthenticated = false;<br />
<br />
			// check against active directory if they are in dashboard group by returning all the groups in a String Collection and looping<br />
			try<br />
			{<br />
				// Create new Authenticate class<br />
				CustomClasses.Authenticate cAuthenticate = new Authenticate();<br />
				// Call method passing in username to return all groups user belongs to<br />
				StringCollection scGroups = (cAuthenticate.GetUserGroupMembership(strUname));<br />
				//loop through colection of strings corresponding to Active Directory groups user is in<br />
				foreach (string gp in scGroups)<br />
				{<br />
					// If the group is = to DASHBOARD then the user is authorised to see the dashboard<br />
					if(gp.Substring(3,gp.Length - 3).ToUpper() == "DASHBOARD")<br />
						// set bIsAuthorsied to true for comparison later<br />
						bIsAuthenticated = true;<br />
					else<br />
						Session.Add("exception", "1");<br />
				}			<br />
			}<br />


Hope this helps

Colin
Questionaspx to asp conversion Pin
vijayendra_shinde18-Apr-06 21:55
vijayendra_shinde18-Apr-06 21:55 
AnswerRe: aspx to asp conversion Pin
HimaBindu Vejella18-Apr-06 22:58
HimaBindu Vejella18-Apr-06 22:58 
AnswerRe: aspx to asp conversion Pin
enjoycrack19-Apr-06 0:36
enjoycrack19-Apr-06 0:36 
Questionopen a PDF report Pin
Jmshastri18-Apr-06 21:50
Jmshastri18-Apr-06 21:50 
AnswerRe: open a PDF report Pin
Paddy Boyd19-Apr-06 2:14
Paddy Boyd19-Apr-06 2:14 
QuestionGrid View paging Pin
?!?18-Apr-06 21:48
?!?18-Apr-06 21:48 
Questiondropdown list Pin
ptvce18-Apr-06 20:48
ptvce18-Apr-06 20:48 
AnswerRe: dropdown list Pin
enjoycrack18-Apr-06 21:10
enjoycrack18-Apr-06 21:10 
GeneralRe: dropdown list Pin
ptvce18-Apr-06 22:23
ptvce18-Apr-06 22:23 
GeneralRe: dropdown list Pin
enjoycrack18-Apr-06 22:40
enjoycrack18-Apr-06 22:40 
GeneralRe: dropdown list Pin
VaibhavJ18-Apr-06 22:43
VaibhavJ18-Apr-06 22:43 
AnswerRe: dropdown list Pin
VaibhavJ18-Apr-06 23:12
VaibhavJ18-Apr-06 23:12 
GeneralRe: dropdown list Pin
enjoycrack19-Apr-06 0:48
enjoycrack19-Apr-06 0:48 
GeneralRe: dropdown list Pin
VaibhavJ19-Apr-06 0:54
VaibhavJ19-Apr-06 0:54 
GeneralRe: dropdown list Pin
RSArockiam19-Apr-06 2:34
RSArockiam19-Apr-06 2:34 
GeneralRe: dropdown list Pin
VaibhavJ19-Apr-06 4:01
VaibhavJ19-Apr-06 4:01 
GeneralRe: dropdown list Pin
ptvce19-Apr-06 4:55
ptvce19-Apr-06 4:55 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.