Click here to Skip to main content
15,888,610 members
Home / Discussions / C#
   

C#

 
GeneralRe: Textbox onTextChanged method. Pin
vanikanc31-Aug-11 10:13
vanikanc31-Aug-11 10:13 
AnswerRe: Textbox onTextChanged method. Pin
Luc Pattyn31-Aug-11 12:51
sitebuilderLuc Pattyn31-Aug-11 12:51 
GeneralRe: Textbox onTextChanged method. Pin
BillWoodruff2-Sep-11 2:21
professionalBillWoodruff2-Sep-11 2:21 
QuestionObserver Design Patterns! Pin
borges0231-Aug-11 8:52
borges0231-Aug-11 8:52 
AnswerRe: Observer Design Patterns! Pin
Pete O'Hanlon31-Aug-11 9:22
mvePete O'Hanlon31-Aug-11 9:22 
QuestionWhat's the difference between Proxy Patterns and Observer Patterns? Pin
borges0231-Aug-11 7:44
borges0231-Aug-11 7:44 
AnswerRe: What's the difference between Proxy Patterns and Observer Patterns? Pin
Abhinav S31-Aug-11 8:00
Abhinav S31-Aug-11 8:00 
QuestionC#.net class library error Pin
dcof31-Aug-11 7:22
dcof31-Aug-11 7:22 
Can you tell me what is wrong with this code?

In an exisitng C#.net 2008 desktop application, I want to setup a class .cs file so I can do security checks against the active directory. I want to add this code to a project file that contains lots of common routines all the other processing modules use. The code is the following:

using System;
using System.Reflection;
using System.Runtime.Remoting;
using System.IO;
using System.Threading;
using System.Windows.Forms;
using System.Security.Principal;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace En.Common
{
class ActiveDirectory

{

AppDomain.CurrentDomain.SetPrincipalPolicy(PrincipalPolicy.WindowsPrincipal);
//Thread.CurrentPrincipal = new WindowsPrincipal(WindowsIdentity.GetCurrent());
//if ((!Thread.CurrentPrincipal.IsInRole("testit")))

}

}


I want to start with 3 lines of code listed so far. However, the statement,

AppDomain.CurrentDomain.SetPrincipalPolicy(PrincipalPolicy.WindowsPrincipal);

However I am getting the following two errors on this statement:

Error 94 Invalid token '(' in class, struct, or interface member declaration

Error 95 Invalid token ')' in class, struct, or interface member declaration
AnswerRe: C#.net class library error PinPopular
Wayne Gaylard31-Aug-11 7:34
professionalWayne Gaylard31-Aug-11 7:34 
QuestionCustom Control Regions Pin
cjb11030-Aug-11 23:58
cjb11030-Aug-11 23:58 
AnswerRe: Custom Control Regions Pin
BobJanova31-Aug-11 0:27
BobJanova31-Aug-11 0:27 
GeneralRe: Custom Control Regions Pin
cjb11031-Aug-11 0:40
cjb11031-Aug-11 0:40 
GeneralRe: Custom Control Regions Pin
BobJanova31-Aug-11 7:43
BobJanova31-Aug-11 7:43 
GeneralRe: Custom Control Regions Pin
cjb1102-Sep-11 2:27
cjb1102-Sep-11 2:27 
Questionhow to associate file type in window registry for c# program ? Pin
Kim061830-Aug-11 23:29
Kim061830-Aug-11 23:29 
AnswerRe: how to associate file type in window registry for c# program ? Pin
BobJanova31-Aug-11 0:20
BobJanova31-Aug-11 0:20 
AnswerRe: how to associate file type in window registry for c# program ? Pin
Tony Pazzard31-Aug-11 3:28
Tony Pazzard31-Aug-11 3:28 
AnswerRe: how to associate file type in window registry for c# program ? Pin
PIEBALDconsult31-Aug-11 3:29
mvePIEBALDconsult31-Aug-11 3:29 
QuestionProblem while reading data from excel in c# Pin
nainakarri30-Aug-11 20:33
nainakarri30-Aug-11 20:33 
AnswerRe: Problem while reading data from excel in c# Pin
Wayne Gaylard30-Aug-11 21:29
professionalWayne Gaylard30-Aug-11 21:29 
GeneralRe: Problem while reading data from excel in c# Pin
Mycroft Holmes30-Aug-11 22:38
professionalMycroft Holmes30-Aug-11 22:38 
GeneralRe: Problem while reading data from excel in c# Pin
Wayne Gaylard30-Aug-11 22:56
professionalWayne Gaylard30-Aug-11 22:56 
GeneralRe: Problem while reading data from excel in c# Pin
nainakarri30-Aug-11 23:01
nainakarri30-Aug-11 23:01 
GeneralRe: Problem while reading data from excel in c# Pin
Wayne Gaylard30-Aug-11 23:06
professionalWayne Gaylard30-Aug-11 23:06 
QuestionGet object back from server with .net remoting and Socket connection Pin
MahieuBrecht30-Aug-11 20:03
MahieuBrecht30-Aug-11 20:03 

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.