Click here to Skip to main content
15,889,335 members
Home / Discussions / C#
   

C#

 
GeneralDevice Pin
sreejith ss nair6-Aug-04 3:26
sreejith ss nair6-Aug-04 3:26 
GeneralRe: Device Pin
Dave Kreskowiak6-Aug-04 3:46
mveDave Kreskowiak6-Aug-04 3:46 
GeneralRe: Device Pin
Nick Parker6-Aug-04 3:59
protectorNick Parker6-Aug-04 3:59 
GeneralRe: Device Pin
Michael P Butler6-Aug-04 5:07
Michael P Butler6-Aug-04 5:07 
GeneralForm location Pin
the last free name6-Aug-04 2:30
the last free name6-Aug-04 2:30 
GeneralRe: Form location Pin
Nick Parker6-Aug-04 3:28
protectorNick Parker6-Aug-04 3:28 
GeneralRe: Form location Pin
the last free name6-Aug-04 3:40
the last free name6-Aug-04 3:40 
GeneralAgain: Reflection and array´s... Pin
Norman-Timo6-Aug-04 2:27
Norman-Timo6-Aug-04 2:27 
Hello everybody!

My problem is to get/set individual array items which are instanced via reflection.

To give you an overwiew here´s some code:

***************************************************

System.Reflection.Assembly assembly;
assembly = System.Reflection.Assembly.LoadFrom(dllfilename);

foreach(Type assemblyType in assembly.GetTypes())
{
if (assemblyType.IsClass)
objInstance = Activator.CreateInstance(viptype);

foreach(FieldInfo f in objInstance.GetFields(BindingFlags.Public | BindingFlags.Instance))
{
if (f.FieldType.IsArray)
{
// read every array value!
// f.GetValue(objInstance) returns only a complete value (and I don´t know how to handle this)
// How can I access to every array item itself???
}
else
{
// do something different. This is working fine!
}
}
}

*************************************************

And the source from the assembly looks something like that (extremely shortened, but same structure):

************************

public class myClass
{
public int ID;

// Test
public int Test;

// Array
public int array[15];
}

************************


How can I get in the source at the top for example the 10th integer of the array?

Please help me
Norman-Timo
GeneralRe: Again: Reflection and array´s... Pin
Nick Parker6-Aug-04 3:12
protectorNick Parker6-Aug-04 3:12 
GeneralRe: Again: Reflection and array´s... Pin
leppie6-Aug-04 5:06
leppie6-Aug-04 5:06 
GeneralMDI Child Window Sizing Pin
James Spibey6-Aug-04 1:13
James Spibey6-Aug-04 1:13 
QuestionHow to find File from C# code Pin
Member 12499155-Aug-04 23:41
Member 12499155-Aug-04 23:41 
AnswerRe: How to find File from C# code Pin
Nick Parker6-Aug-04 3:04
protectorNick Parker6-Aug-04 3:04 
AnswerRe: How to find File from C# code Pin
Looney Tunezez6-Aug-04 10:29
Looney Tunezez6-Aug-04 10:29 
GeneralTrace in .NET remoting Pin
Md Saleem Navalur5-Aug-04 23:05
Md Saleem Navalur5-Aug-04 23:05 
GeneralRe: Trace in .NET remoting Pin
Heath Stewart6-Aug-04 4:49
protectorHeath Stewart6-Aug-04 4:49 
GeneralSpliting Controls Pin
sreejith ss nair5-Aug-04 23:01
sreejith ss nair5-Aug-04 23:01 
GeneralRe: Spliting Controls Pin
Heath Stewart6-Aug-04 4:51
protectorHeath Stewart6-Aug-04 4:51 
Questionhow to send an e-mail to hotmail??? Pin
shdelpiero5-Aug-04 22:40
shdelpiero5-Aug-04 22:40 
AnswerRe: how to send an e-mail to hotmail??? Pin
sreejith ss nair5-Aug-04 23:20
sreejith ss nair5-Aug-04 23:20 
GeneralRe: how to send an e-mail to hotmail??? Pin
Heath Stewart6-Aug-04 4:55
protectorHeath Stewart6-Aug-04 4:55 
Questionhow to close the form after specific time?? Pin
shdelpiero5-Aug-04 22:27
shdelpiero5-Aug-04 22:27 
AnswerRe: how to close the form after specific time?? Pin
Colin Angus Mackay5-Aug-04 22:55
Colin Angus Mackay5-Aug-04 22:55 
GeneralRe: how to close the form after specific time?? Pin
exhaulted6-Aug-04 0:41
exhaulted6-Aug-04 0:41 
GeneralColor Pin
sreejith ss nair5-Aug-04 21:56
sreejith ss nair5-Aug-04 21:56 

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.