Click here to Skip to main content
15,891,657 members
Home / Discussions / C#
   

C#

 
GeneralRe: GetWindowText Funcation not working Fine iF Application Title is Unicode or Other Language. Pin
Richard MacCutchan1-Feb-11 1:08
mveRichard MacCutchan1-Feb-11 1:08 
GeneralRe: GetWindowText Funcation not working Fine iF Application Title is Unicode or Other Language. Pin
Anubhava Dimri1-Feb-11 19:17
Anubhava Dimri1-Feb-11 19:17 
GeneralRe: GetWindowText Funcation not working Fine iF Application Title is Unicode or Other Language. Pin
Richard MacCutchan1-Feb-11 22:04
mveRichard MacCutchan1-Feb-11 22:04 
GeneralRe: GetWindowText Funcation not working Fine iF Application Title is Unicode or Other Language. Pin
Pete O'Hanlon1-Feb-11 1:26
mvePete O'Hanlon1-Feb-11 1:26 
QuestionProblem executing Comman-line command - Need to press Ctrl+C to stop it ! Pin
All Time Programming31-Jan-11 22:23
All Time Programming31-Jan-11 22:23 
AnswerRe: Problem executing Comman-line command - Need to press Ctrl+C to stop it ! Pin
JF201531-Jan-11 22:56
JF201531-Jan-11 22:56 
GeneralRe: Problem executing Comman-line command - Need to press Ctrl+C to stop it ! Pin
All Time Programming31-Jan-11 23:02
All Time Programming31-Jan-11 23:02 
QuestionBlock Windows "Guest" account Pin
marca29231-Jan-11 21:00
marca29231-Jan-11 21:00 
Hi,

I want to restrict users log on the computer from Windows "Guest" account from starting our application. Our application can be used on XP, Vista and Windows 7.
What is wrong with this solution, I get SecurityException when testing from Win7 guest account, I have tried both PrincipalPermission(null, "Guests"); and PrincipalPermission(null, "Guest");
I have also tried to use PrincipalPermission(null, "Administrators"); and then I can use the application from Admin account but not from guest account.

static void Main()
{
AppDomain.CurrentDomain.SetPrincipalPolicy(PrincipalPolicy.WindowsPrincipal);
PrincipalPermission principalGuest = new PrincipalPermission(null, "Guest"); //Has also tested with "Guests"

try
{
principalGuest.Demand();
}
catch (SecurityException e)
{
//I only want to get this exception if the user is Windows account type "guest"
}
}

Best regards
Olof
AnswerRe: Block Windows "Guest" account Pin
RobCroll31-Jan-11 23:33
RobCroll31-Jan-11 23:33 
GeneralRe: Block Windows "Guest" account Pin
marca2921-Feb-11 3:13
marca2921-Feb-11 3:13 
GeneralRe: Block Windows "Guest" account Pin
RobCroll1-Feb-11 12:14
RobCroll1-Feb-11 12:14 
QuestionAny injection experts? Pin
dawmail33331-Jan-11 20:47
dawmail33331-Jan-11 20:47 
AnswerRe: Any injection experts? Pin
Eddy Vluggen1-Feb-11 7:22
professionalEddy Vluggen1-Feb-11 7:22 
GeneralRe: Any injection experts? Pin
dawmail3331-Feb-11 9:23
dawmail3331-Feb-11 9:23 
GeneralRe: Any injection experts? Pin
Eddy Vluggen1-Feb-11 20:31
professionalEddy Vluggen1-Feb-11 20:31 
QuestionDebug.WriteLine Pin
Ray Cassick31-Jan-11 15:45
Ray Cassick31-Jan-11 15:45 
AnswerRe: Debug.WriteLine Pin
Luc Pattyn31-Jan-11 16:16
sitebuilderLuc Pattyn31-Jan-11 16:16 
GeneralRe: Debug.WriteLine Pin
Ray Cassick31-Jan-11 16:38
Ray Cassick31-Jan-11 16:38 
AnswerRe: Debug.WriteLine Pin
Luc Pattyn31-Jan-11 16:44
sitebuilderLuc Pattyn31-Jan-11 16:44 
GeneralRe: Debug.WriteLine Pin
Ray Cassick31-Jan-11 17:01
Ray Cassick31-Jan-11 17:01 
GeneralRe: Debug.WriteLine Pin
Pravin Patil, Mumbai31-Jan-11 19:00
Pravin Patil, Mumbai31-Jan-11 19:00 
AnswerRe: Debug.WriteLine Pin
Abhinav S31-Jan-11 20:04
Abhinav S31-Jan-11 20:04 
QuestionExecute code only if query successful Pin
Joe Stansfield31-Jan-11 11:29
Joe Stansfield31-Jan-11 11:29 
AnswerRe: Execute code only if query successful Pin
Not Active31-Jan-11 12:07
mentorNot Active31-Jan-11 12:07 
QuestionRe: Execute code only if query successful Pin
Paw Jershauge31-Jan-11 12:24
Paw Jershauge31-Jan-11 12:24 

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.