Results 1 to 2 of 2

Thread: how to convert this c# to vb.net

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Aug 2002
    Location
    Norwich, UK
    Posts
    405

    how to convert this c# to vb.net

    Code:
    		public virtual User this[string Username] 
    		{
    			get 
    			{
    				int index = -1;
    				for (int i=0; i<this.List.Count; i++)
    				{
    					if (((User)this.List[i]).UserName==Username)
    					{
    						index = i;
    					}
    				}
    				if (index==-1){throw new NullReferenceException ("The User " + Username + " was not found.");}
    				if (!((User)this.List[index]).IsLoaded)
    				{
    					((User)this.List[index]).Load();
    				}
    				return (User) this.List[index];
    			}
    			set 
    			{
    				int index = -1;
    				for (int i=0; i<this.List.Count; i++)
    				{
    					if (((User)this.List[i]).UserName==Username)
    					{
    						index = i;
    					}
    				}
    				if (index==-1){throw new NullReferenceException ("The User " + Username + " was not found.");}
    				this.List[index] = value;
    			}
    		}

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

    Re: how to convert this c# to vb.net


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