Click here to Skip to main content
15,924,402 members
Home / Discussions / C#
   

C#

 
AnswerRe: Requesting WebPage using TCPClient Pin
SakthiSurya3-May-07 21:48
SakthiSurya3-May-07 21:48 
AnswerRe: Requesting WebPage using TCPClient Pin
Herman<T>.Instance3-May-07 23:29
Herman<T>.Instance3-May-07 23:29 
GeneralRe: Requesting WebPage using TCPClient Pin
SakthiSurya4-May-07 2:18
SakthiSurya4-May-07 2:18 
GeneralRe: Requesting WebPage using TCPClient Pin
Herman<T>.Instance6-May-07 22:07
Herman<T>.Instance6-May-07 22:07 
QuestionRegistry Editor Pin
Paramhans Dubey3-May-07 19:17
professionalParamhans Dubey3-May-07 19:17 
AnswerRe: Registry Editor Pin
Shajeel3-May-07 20:29
Shajeel3-May-07 20:29 
QuestionIndexers in c# Pin
Raheem MA3-May-07 18:43
Raheem MA3-May-07 18:43 
AnswerRe: Indexers in c# Pin
Sandeep Akhare3-May-07 20:07
Sandeep Akhare3-May-07 20:07 
Hi Shah
Indexers allows you to access the object like you are accessing the array .
Indexers permit instances of a class or struct to be indexed in the same way as arrays. Indexers are similar to properties except that their accessors take parameters

<br />
class SampleCollection<T><br />
{<br />
    private T[] arr = new T[100];<br />
    public T this[int i]<br />
    {<br />
        get<br />
        {<br />
            return arr[i];<br />
        }<br />
        set<br />
        {<br />
            arr[i] = value;<br />
        }<br />
    }<br />
}<br />
<br />
// This class shows how client code uses the indexer<br />
class Program<br />
{<br />
    static void Main(string[] args)<br />
    {<br />
        SampleCollection<string> stringCollection = new SampleCollection<string>();<br />
        stringCollection[0] = "Hello, World";<br />
        System.Console.WriteLine(stringCollection[0]);<br />
    }<br />
}<br />
<br />
<br />


Indexers enable objects to be indexed in a similar way to arrays.

A get accessor returns a value. A set accessor assigns a value.

The this keyword is used to define the indexers.

The value keyword is used to define the value being assigned by the set indexer.

Indexers do not have to be indexed by an integer value; it is up to you how to define the specific look-up mechanism.

Indexers can be overloaded.

Indexers can have more than one formal parameter, for example, when accessing a two-dimensional array.


Thanks and Regards
Sandeep

If you want something you never had,
do something you have never done!


Questionregarding listbox C# Pin
giribabu2343-May-07 18:42
giribabu2343-May-07 18:42 
AnswerRe: regarding listbox C# Pin
Sandeep Akhare3-May-07 20:02
Sandeep Akhare3-May-07 20:02 
QuestionDisplay a web control Link button in a html tag Pin
minlynn3-May-07 16:52
minlynn3-May-07 16:52 
AnswerRe: Display a web control Link button in a html tag Pin
Sandeep Akhare3-May-07 20:11
Sandeep Akhare3-May-07 20:11 
GeneralRe: Display a web control Link button in a html tag Pin
minlynn6-May-07 18:27
minlynn6-May-07 18:27 
QuestionSorting a collection of classes [modified] Pin
hpjchobbes3-May-07 16:34
hpjchobbes3-May-07 16:34 
AnswerRe: Sorting a collection of classes Pin
Stefan Troschuetz3-May-07 21:07
Stefan Troschuetz3-May-07 21:07 
AnswerRe: Sorting a collection of classes Pin
Jon Hulatt3-May-07 21:11
Jon Hulatt3-May-07 21:11 
AnswerRe: Sorting a collection of classes Pin
AFSEKI7-May-07 4:01
AFSEKI7-May-07 4:01 
QuestionC#, DWM, and Window Image Capture (Vista) Pin
surrealmadrid3-May-07 12:22
surrealmadrid3-May-07 12:22 
Questionimage to string and backwords.. Pin
Seishin#3-May-07 11:33
Seishin#3-May-07 11:33 
AnswerRe: image to string and backwords.. Pin
Luc Pattyn3-May-07 11:47
sitebuilderLuc Pattyn3-May-07 11:47 
GeneralRe: image to string and backwords.. Pin
Seishin#3-May-07 19:13
Seishin#3-May-07 19:13 
AnswerRe: image to string and backwords.. Pin
Stefan Prodan3-May-07 12:30
Stefan Prodan3-May-07 12:30 
GeneralRe: image to string and backwords.. Pin
Seishin#3-May-07 19:14
Seishin#3-May-07 19:14 
GeneralRe: image to string and backwords.. Pin
Stefan Prodan4-May-07 0:42
Stefan Prodan4-May-07 0:42 
AnswerRe: image to string and backwords.. Pin
AFSEKI7-May-07 4:08
AFSEKI7-May-07 4:08 

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.