Click here to Skip to main content
15,907,677 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: Hitcounter problem...please guide.. Pin
mr_muskurahat24-Nov-08 23:33
mr_muskurahat24-Nov-08 23:33 
Question[Message Deleted] Pin
shanthi jothi24-Nov-08 21:32
shanthi jothi24-Nov-08 21:32 
AnswerRe: Generate Payslip Pin
Krazy Programmer25-Nov-08 1:21
Krazy Programmer25-Nov-08 1:21 
AnswerRe: Generate Payslip Pin
Abhijit Jana25-Nov-08 1:51
professionalAbhijit Jana25-Nov-08 1:51 
Questioncreating ssis package using C#.net Pin
l.laxmikant24-Nov-08 20:57
l.laxmikant24-Nov-08 20:57 
QuestionHow to find group of single user from active directory.?? Pin
Piyush Vardhan Singh24-Nov-08 20:22
Piyush Vardhan Singh24-Nov-08 20:22 
AnswerRe: How to find group of single user from active directory.?? Pin
Christian Graus24-Nov-08 20:33
protectorChristian Graus24-Nov-08 20:33 
GeneralRe: How to find group of single user from active directory.?? Pin
Piyush Vardhan Singh24-Nov-08 21:19
Piyush Vardhan Singh24-Nov-08 21:19 
Answer:-Rose | [Rose]


Private Function GetGroups(ByVal _path As String, ByVal _
username As String, ByVal password As String) As String
Dim GroupString As String
Dim myDE As New System.DirectoryServices.DirectoryEntry(_path, _
username, password)

Dim mySearcher As New DirectorySearcher(myDE)

mySearcher.Filter = "sAMAccountName=" & username
mySearcher.PropertiesToLoad.Add("memberOf")
Dim propertyCount As Integer

Try

Dim myresult As SearchResult = mySearcher.FindOne()
propertyCount = myresult.Properties("memberOf").Count

Dim dn As String
Dim equalsIndex, commaIndex As String

For i As Integer = 0 To propertyCount - 1
dn = myresult.Properties("memberOf")(i)
equalsIndex = dn.IndexOf("=", 1)
commaIndex = dn.IndexOf(",", 1)
If equalsIndex = -1 Then
Return Nothing
End If

GroupString += dn.Substring((equalsIndex + 1), _
(commaIndex - equalsIndex) - 1) & "/"

Next
Return GroupString

Catch ex As Exception
If ex.GetType Is GetType(System.NullReferenceException) Then


'they are still a good user just does not
'have a "memberOf" attribute so it errors out.
'code to do something else here if you want
Else

End If
End Try

End Function

Piyush Vardhan Singh
p_vardhan14@rediffmail.com
http://holyschoolofvaranasi.blogspot.com
http://holytravelsofvaranasi.blogspot.com



QuestionShow checkbox inside a dropdownlist Pin
SreejithAchutan24-Nov-08 19:30
SreejithAchutan24-Nov-08 19:30 
AnswerRe: Show checkbox inside a dropdownlist Pin
Christian Graus24-Nov-08 19:34
protectorChristian Graus24-Nov-08 19:34 
AnswerRe: Show checkbox inside a dropdownlist Pin
Abhijit Jana24-Nov-08 19:34
professionalAbhijit Jana24-Nov-08 19:34 
QuestionShow data in gridview vertically and update vertically also? Pin
pundir abhishek24-Nov-08 19:20
pundir abhishek24-Nov-08 19:20 
AnswerRe: Show data in gridview vertically and update vertically also? Pin
Christian Graus24-Nov-08 19:26
protectorChristian Graus24-Nov-08 19:26 
QuestionFetch all the permissions of a folder/file of IUser [modified] Pin
Pankaj Saha24-Nov-08 19:19
Pankaj Saha24-Nov-08 19:19 
AnswerRe: Fetch all the permissions of a folder/file of IUser Pin
Christian Graus24-Nov-08 19:25
protectorChristian Graus24-Nov-08 19:25 
Questionhow to read the data of a comp port through asp.net page Pin
souravghosh1824-Nov-08 19:00
souravghosh1824-Nov-08 19:00 
AnswerRe: how to read the data of a comp port through asp.net page Pin
Christian Graus24-Nov-08 19:06
protectorChristian Graus24-Nov-08 19:06 
GeneralRe: how to read the data of a comp port through asp.net page Pin
souravghosh1824-Nov-08 19:25
souravghosh1824-Nov-08 19:25 
GeneralRe: how to read the data of a comp port through asp.net page Pin
Abhijit Jana24-Nov-08 19:29
professionalAbhijit Jana24-Nov-08 19:29 
GeneralRe: how to read the data of a comp port through asp.net page Pin
Christian Graus24-Nov-08 19:33
protectorChristian Graus24-Nov-08 19:33 
QuestionSecurity Trimming Enabled Pin
kenexcelon24-Nov-08 10:56
kenexcelon24-Nov-08 10:56 
GeneralRe: Security Trimming Enabled Pin
Guffa24-Nov-08 13:57
Guffa24-Nov-08 13:57 
GeneralRe: Security Trimming Enabled Pin
kenexcelon24-Nov-08 14:19
kenexcelon24-Nov-08 14:19 
QuestionDynamically adding controls to a page Pin
gantww24-Nov-08 10:39
gantww24-Nov-08 10:39 
AnswerRe: Dynamically adding controls to a page Pin
Christian Graus24-Nov-08 10:52
protectorChristian Graus24-Nov-08 10:52 

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.