Click here to Skip to main content
15,899,754 members
Home / Discussions / C#
   

C#

 
GeneralRe: Image Embeded into a User Control Library Pin
acastano5-Nov-05 5:30
acastano5-Nov-05 5:30 
GeneralRe: Image Embeded into a User Control Library Pin
Christian Graus6-Nov-05 11:41
protectorChristian Graus6-Nov-05 11:41 
QuestionControls - override members or use events? Pin
User 5838523-Nov-05 11:33
User 5838523-Nov-05 11:33 
AnswerRe: Controls - override members or use events? Pin
Christian Graus3-Nov-05 11:47
protectorChristian Graus3-Nov-05 11:47 
AnswerRe: Controls - override members or use events? Pin
Jon Rista4-Nov-05 16:47
Jon Rista4-Nov-05 16:47 
Questionusing MSAccess in C# Pin
ASPERSICA3-Nov-05 11:25
ASPERSICA3-Nov-05 11:25 
AnswerRe: using MSAccess in C# Pin
enjoycrack3-Nov-05 13:17
enjoycrack3-Nov-05 13:17 
Questionmethod problem Pin
nbaker3-Nov-05 10:30
nbaker3-Nov-05 10:30 
I currently have a method in a class library that is being accessed via .net remoting. The remote object handles active directory functions such as authentication, and getting the groups associated with an authenticated user. My problem is that when I call the method to get the groups for the authenticated user, it fails (something about not being able to find the domain or ldap server), but when i copy that method into my web app and call it directly from the web app, it works fine. Here is the code in the remote object's method:

<code>
public string GetGroups(string strPath, string strFilterAttribute)
{
DirectorySearcher search = new DirectorySearcher(strPath);
search.Filter = "(cn=" + strFilterAttribute + ")";
search.PropertiesToLoad.Add("memberOf");
StringBuilder groupNames = new StringBuilder();

try
{
SearchResult result = search.FindOne();
int propertyCount = result.Properties["memberOf"].Count;
string dn;
int equalsIndex, commaIndex;

for(int propertyCounter = 0; propertyCounter < propertyCount; propertyCounter++)
{
dn = (string)result.Properties["memberOf"][propertyCounter];
equalsIndex = dn.IndexOf("=", 1);
commaIndex = dn.IndexOf(",", 1);
if(-1 == equalsIndex)
{
return null;
}
groupNames.Append(dn.Substring((equalsIndex + 1), (commaIndex - equalsIndex) - 1));
groupNames.Append("|");
}
}
catch(Exception ex)
{
throw new Exception("Error obtaining group names. " + ex.Message);
}
return groupNames.ToString();
}
</code>

I use this to call it remotely (the necessary set up to call the remote object is already taken care of at this point):

<code>string strGroups = myRemote.GetGroups(strPath, strFilterAttribute);</code>

This way causes the error, but when I copy and paste the same method into my web app, I call this way:
<code>string strGroups = GetGroups(strPath, strFilterAttribute);</code>
and it works perfectly. Does anyone have any ideas as to why? Also is there a way to run my web app in debug mode and at the same time run my remote object in debug mode so that I can step into it when it is called? I remember doing this in VB 6 with COM objects (dlls).

Thanks in advance
AnswerRe: method problem Pin
S. Senthil Kumar3-Nov-05 17:57
S. Senthil Kumar3-Nov-05 17:57 
GeneralRe: method problem Pin
nbaker4-Nov-05 1:40
nbaker4-Nov-05 1:40 
QuestionWindow service and system tray Pin
vidyaN3-Nov-05 9:50
vidyaN3-Nov-05 9:50 
AnswerRe: Window service and system tray Pin
Jon Rista4-Nov-05 16:51
Jon Rista4-Nov-05 16:51 
GeneralRe: Window service and system tray Pin
vidyaN7-Nov-05 7:27
vidyaN7-Nov-05 7:27 
GeneralRe: Window service and system tray Pin
Jon Rista8-Nov-05 7:02
Jon Rista8-Nov-05 7:02 
QuestionXML Formatted String and Collection with dynamic value types Pin
budidharma3-Nov-05 9:19
budidharma3-Nov-05 9:19 
AnswerRe: XML Formatted String and Collection with dynamic value types Pin
Wjousts3-Nov-05 10:57
Wjousts3-Nov-05 10:57 
GeneralRe: XML Formatted String and Collection with dynamic value types Pin
budidharma3-Nov-05 12:40
budidharma3-Nov-05 12:40 
GeneralRe: XML Formatted String and Collection with dynamic value types Pin
S. Senthil Kumar3-Nov-05 18:01
S. Senthil Kumar3-Nov-05 18:01 
AnswerRe: XML Formatted String and Collection with dynamic value types Pin
Jon Rista4-Nov-05 16:53
Jon Rista4-Nov-05 16:53 
QuestionGeting data from another program Pin
JJDIII3-Nov-05 8:57
JJDIII3-Nov-05 8:57 
AnswerRe: Accepting a string from another program Pin
Dave Kreskowiak3-Nov-05 14:13
mveDave Kreskowiak3-Nov-05 14:13 
GeneralRe: Accepting a string from another program Pin
JJDIII4-Nov-05 2:24
JJDIII4-Nov-05 2:24 
GeneralRe: Accepting a string from another program Pin
Dave Kreskowiak4-Nov-05 12:07
mveDave Kreskowiak4-Nov-05 12:07 
Questionchanging references for different configurations Pin
BlackDice3-Nov-05 8:23
BlackDice3-Nov-05 8:23 
AnswerRe: changing references for different configurations Pin
.NetRocker3-Nov-05 10:26
.NetRocker3-Nov-05 10:26 

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.