How do I pass an array of integers from classic asp to a c# COM object?

oneandonlysunny

New Member
I'm trying to pass an array of integers from Classic ASP to a DLL created in C#.I have the following C# method:\[code\]public int passIntArray(object arr){ int[] ia = (int[])arr; int sum = 0; for (int i = 0; i < ia.Length; i++) sum += ia; return sum;}\[/code\]I've tried a number of ways to convert arr to an int[], but not having any success. My asp code is:\[code\]var arr = [1,2,3,4,5,6];var x = Server.CreateObject("dllTest.test");Response.Write(x.passIntArray(arr));\[/code\]Can anyone tell me how to do it or tell me it can't be done?
 
Back
Top