Click here to Skip to main content
16,005,080 members
Home / Discussions / C#
   

C#

 
Questionuplaoding crystal report Pin
mohd imran abdul aziz31-Jan-07 2:52
mohd imran abdul aziz31-Jan-07 2:52 
QuestionHow to get control value from one project to other project Pin
indiaone31-Jan-07 2:19
indiaone31-Jan-07 2:19 
AnswerRe: How to get control value from one project to other project Pin
Not Active31-Jan-07 2:34
mentorNot Active31-Jan-07 2:34 
QuestionHow to get the windows login un and pw in c# Pin
VijayaRam31-Jan-07 1:44
VijayaRam31-Jan-07 1:44 
AnswerRe: How to get the windows login un and pw in c# Pin
Colin Angus Mackay31-Jan-07 2:08
Colin Angus Mackay31-Jan-07 2:08 
GeneralRe: How to get the windows login un and pw in c# Pin
VijayaRam31-Jan-07 2:12
VijayaRam31-Jan-07 2:12 
GeneralRe: How to get the windows login un and pw in c# Pin
xstoneheartx31-Jan-07 2:23
xstoneheartx31-Jan-07 2:23 
AnswerRe: How to get the windows login un and pw in c# Pin
MrEyes31-Jan-07 2:56
MrEyes31-Jan-07 2:56 
It isnt possible to get the user password, however you can validate it using the follow api call

const int LOGON32_LOGON_INTERACTIVE = 2;
const int LOGON32_PROVIDER_DEFAULT = 0;

[DllImport("advapi32.dll", SetLastError=true)]
private static extern bool LogonUser(String lpszUsername, String lpszDomain, String lpszPassword, int dwLogonType, int dwLogonProvider, ref IntPtr phToken);

private void DoLogonCheck(string userName, string domainName, string password)
{
 IntPtr phToken = IntPtr.Zero;
 bool logonRes = LogonUser(
  userName,
  domainName,
  password, 
  LOGON32_LOGON_INTERACTIVE,
  LOGON32_PROVIDER_DEFAULT,
  ref phToken);

 if (logonRes)
 {
  Console.WriteLine("Good logon with username : {0}", userName)
 }
 else
 {
  Console.WriteLine("Bad logon with username : {0}", userName)
 }
}


I use a similar piece of code to validate that the user true user is sat in front of the machine and not that they have left it unlocked.
QuestionGet image from RichTextBox. Pin
god4k31-Jan-07 1:33
god4k31-Jan-07 1:33 
AnswerRe: Get image from RichTextBox. Pin
xstoneheartx31-Jan-07 2:31
xstoneheartx31-Jan-07 2:31 
QuestionMultiple select in listbox Pin
Andrew Em31-Jan-07 1:32
Andrew Em31-Jan-07 1:32 
AnswerRe: Multiple select in listbox Pin
Stefan Troschuetz31-Jan-07 1:59
Stefan Troschuetz31-Jan-07 1:59 
GeneralRe: Multiple select in listbox Pin
Andrew Em31-Jan-07 2:06
Andrew Em31-Jan-07 2:06 
AnswerRe: Multiple select in listbox Pin
VijayaRam31-Jan-07 2:09
VijayaRam31-Jan-07 2:09 
GeneralRe: Multiple select in listbox Pin
Andrew Em31-Jan-07 2:21
Andrew Em31-Jan-07 2:21 
GeneralRe: Multiple select in listbox Pin
Stefan Troschuetz31-Jan-07 2:42
Stefan Troschuetz31-Jan-07 2:42 
JokeRe: Multiple select in listbox Pin
Martin#31-Jan-07 2:56
Martin#31-Jan-07 2:56 
GeneralRe: Multiple select in listbox Pin
Andrew Em31-Jan-07 3:12
Andrew Em31-Jan-07 3:12 
GeneralRe: Multiple select in listbox Pin
Martin#31-Jan-07 3:23
Martin#31-Jan-07 3:23 
GeneralRe: Multiple select in listbox Pin
Stefan Troschuetz31-Jan-07 3:43
Stefan Troschuetz31-Jan-07 3:43 
GeneralRe: Multiple select in listbox Pin
Andrew Em31-Jan-07 3:52
Andrew Em31-Jan-07 3:52 
GeneralRe: Multiple select in listbox Pin
Dan Neely31-Jan-07 3:16
Dan Neely31-Jan-07 3:16 
QuestionCombobox binding Pin
DanB198331-Jan-07 1:24
DanB198331-Jan-07 1:24 
AnswerRe: Combobox binding Pin
tgrt31-Jan-07 2:01
tgrt31-Jan-07 2:01 
AnswerRe: Combobox binding Pin
xstoneheartx31-Jan-07 2:10
xstoneheartx31-Jan-07 2:10 

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.