Results 1 to 4 of 4

Thread: Can someone please take a peek at my code and tear it appart...

  1. #1

    Thread Starter
    Super Moderator Wokawidget's Avatar
    Join Date
    Nov 2001
    Location
    Headingly Occupation: Classified
    Posts
    9,632

    Can someone please take a peek at my code and tear it appart...

    This is my 1st c# project ever. I have not been doing c# for long, but have pushed myself on a crash course with help from people here.

    I would really appreciate if someone can look at my code and tell me I am a muppet and I'm doing things wrong.

    It's got 4 projects and uses inheritance, interfaces, parent child colelction domain model classes plus some other stuff, so it's an all round beginner project.


    All it does is load 3 users into a combo, very simple, but it's all the glue and stuff in the projects that's the interesting bits.


    Woooooooof
    Attached Files Attached Files

  2. #2
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: Can someone please take a peek at my code and tear it appart...

    Woof!

    You are a muppet and doing things wrong!

    I hope your happy that you got to hear what you wanted to hear.


    Anyways, I'm just learning C# like you but it looks good to me other then the fact that you have a timer in there and need a way to enter in your password.

    Nice job for 2 days of C#

    Meooooow!
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  3. #3
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: Can someone please take a peek at my code and tear it appart...

    That's a lot of effort to go through if you're going to perform an .Add() on the objects with the combobox. If you were going to add, you should have simply used User.cs...

    Code:
    		private string username = string.Empty;
    		private string password = string.Empty;
    		
    		public User()
    		{
    			//create blank user class
    		}
    
    		public User(string Username, string Password)
    		{
    			username = Username;
    			password = Password;
    		}
    
    		public string Username
    		{
    			get{return username;}
    			set{username = value;}
    		}
    
    		public string Password
    		{
    			get{return password;}
    			set{password = value;}
    		}
    
    		public override string ToString()
    		{
    			return this.Username;
    		}
    Just that part.

    But I see what you were trying to do, maybe you should create a datasource that the combobox can bind to.

  4. #4
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: Can someone please take a peek at my code and tear it appart...

    Also,

    You are a muppet and... what RD said.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width