Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
B

bes2005

@bes2005
About
Posts
1
Topics
0
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • How can I have access to an arraylist
    B bes2005

    Arrays store System.Object type. When you add a new object or an item of promotive type they will be upcasted to System.Object. This is the line inside ArrayList which adds the new item: public virtual int Add(object value); Use Code DEfinition Window in VS 2005 to see what's inside ArrayList class. In order to access properties you need to down cast the array item you want to acces like: Console.WriteLine(((ServerInfo)myServerArrayList[0]).PropertyName); You would have the same problem if you tried: ArrayList myList = new ArrayList(); int int1 = 1; myList.Add(int1); int int2 = 2; myList.Add(int2); int int3 = myList[0]; // oops error - cannot convert type 'object' to 'int' int int3 = (int)myList[0]; // this will do the trick Happy coding ...

    C# question visual-studio sysadmin help tutorial
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups