I'm having trouble when converting code from C# to VB.NET. I'm not 
used to C# and am using a translation tool at 
http://developerfusion.com/utilities/convertcsharptovb.aspx. The code 
I'm translating works fine in the c# program but I get errors when 
using it in the VB.NET program & I'm not sure why.

Theres an arraylist called 'methods' which is converted to an array 
and then getting methodinfo from it. 

VS error says "Value of System.Array cannot be converted to 
System.Reflection.MethodInfo" yet its ok in C#! The conversion seems 
ok from my knowledge. 


Below is the C# code followed by the translated VB.NET code: 



MethodInfo[] mi = (MethodInfo[])methods.ToArray(typeof(MethodInfo));
                        
ParameterInfo[] pi = mi[drop1.SelectedIndex].GetParameters();
                        paramInfo = pi;

---------------------------- converted to: -------------------------

Dim mi As MethodInfo = CType(methods.ToArray(GetType(MethodInfo)), 
MethodInfo) 

Dim pi As ParameterInfo = mi(drop1.SelectedIndex).GetParameters()





 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/AspNetAnyQuestionIsOk/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



Reply via email to