Click here to Skip to main content
15,881,687 members
Home / Discussions / C#
   

C#

 
QuestionHow to create a Module class in C# similar to VB .NET Pin
LAPEC25-Jan-11 1:23
LAPEC25-Jan-11 1:23 
AnswerRe: How to create a Module class in C# similar to VB .NET Pin
Estys25-Jan-11 1:29
Estys25-Jan-11 1:29 
GeneralRe: How to create a Module class in C# similar to VB .NET Pin
LAPEC25-Jan-11 1:40
LAPEC25-Jan-11 1:40 
GeneralRe: How to create a Module class in C# similar to VB .NET Pin
Pravin Patil, Mumbai25-Jan-11 1:52
Pravin Patil, Mumbai25-Jan-11 1:52 
GeneralRe: How to create a Module class in C# similar to VB .NET Pin
Estys25-Jan-11 2:17
Estys25-Jan-11 2:17 
GeneralRe: How to create a Module class in C# similar to VB .NET Pin
LAPEC25-Jan-11 2:19
LAPEC25-Jan-11 2:19 
GeneralRe: How to create a Module class in C# similar to VB .NET Pin
OriginalGriff25-Jan-11 2:25
mveOriginalGriff25-Jan-11 2:25 
GeneralRe: How to create a Module class in C# similar to VB .NET Pin
OriginalGriff25-Jan-11 2:22
mveOriginalGriff25-Jan-11 2:22 
Estys is right: use as instead:
public override bool Equals(object obj)
   {
   UserClient temp = obj as UserClient;
   if (temp != null)
      {
      return (userPass == temp.userPass);
      }
   return false;
   }
You can also do it with is, but I prefer an explicit null check as it ensures the parameter is valid as well:
public override bool Equals(object obj)
   {
   if (obj is UserClient)
      {
      UserClient temp = (UserClient) obj;
      return (userPass == temp.userPass);
      }
   return false;
   }

Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together.

GeneralRe: How to create a Module class in C# similar to VB .NET Pin
Estys25-Jan-11 2:01
Estys25-Jan-11 2:01 
AnswerRe: How to create a Module class in C# similar to VB .NET Pin
Pravin Patil, Mumbai25-Jan-11 1:41
Pravin Patil, Mumbai25-Jan-11 1:41 
QuestionTextbox Validation against IP Pin
Rei ho24-Jan-11 22:36
Rei ho24-Jan-11 22:36 
AnswerRe: Textbox Validation against IP Pin
OriginalGriff24-Jan-11 22:52
mveOriginalGriff24-Jan-11 22:52 
GeneralRe: Textbox Validation against IP Pin
Rei ho24-Jan-11 22:55
Rei ho24-Jan-11 22:55 
GeneralRe: Textbox Validation against IP Pin
OriginalGriff24-Jan-11 23:00
mveOriginalGriff24-Jan-11 23:00 
GeneralRe: Textbox Validation against IP Pin
Thomas Krojer24-Jan-11 23:11
Thomas Krojer24-Jan-11 23:11 
GeneralRe: Textbox Validation against IP Pin
OriginalGriff24-Jan-11 23:14
mveOriginalGriff24-Jan-11 23:14 
GeneralRe: Textbox Validation against IP Pin
Pete O'Hanlon24-Jan-11 23:49
mvePete O'Hanlon24-Jan-11 23:49 
GeneralRe: Textbox Validation against IP Pin
Rei ho25-Jan-11 14:43
Rei ho25-Jan-11 14:43 
GeneralRe: Textbox Validation against IP [SOLVED] Pin
Rei ho25-Jan-11 15:07
Rei ho25-Jan-11 15:07 
QuestionWPF DataGrid add rows and cells in runtime Pin
Mc_Topaz24-Jan-11 22:33
Mc_Topaz24-Jan-11 22:33 
QuestionLoading a video from a web server and displaying it on my application Pin
Rei ho24-Jan-11 20:30
Rei ho24-Jan-11 20:30 
AnswerRe: Loading a video from a web server and displaying it on my application Pin
RobCroll24-Jan-11 21:33
RobCroll24-Jan-11 21:33 
GeneralRe: Loading a video from a web server and displaying it on my application Pin
Rei ho24-Jan-11 22:40
Rei ho24-Jan-11 22:40 
GeneralRe: Loading a video from a web server and displaying it on my application Pin
RobCroll24-Jan-11 23:54
RobCroll24-Jan-11 23:54 
QuestionExtracting numeric from string Pin
nitin_ion24-Jan-11 20:23
nitin_ion24-Jan-11 20:23 

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.