c#中想调用dll文件后return多个值怎么办?
我的dll文件代码
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ceshi
{
public class Class1
{
double x;
double y;
double[,] A = new double[2, 2];
public double CHENGJI(double a, double b, double c, double d)
{
A[0, 0] = a;
A[0, 1] = b;
A[1, 0] = c;
A[1, 1] = d;
return x = 2 * A[1, 1] + A[0, 1] + A[0, 0] + A[1, 0];
y = 2 * A[1, 1];
}
}
}
我的控制台代码
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using ceshi;
namespace ceshi1
{
class Program
{
static void Main(string[] args)
{
double x;
double y;
double a = 1, b = 2, c = 3, d = 4;
Class1 c1 = new Class1();//实例化对象
x = c1.CHENGJI(a, b, c, d);
y = c1.CHENGJI(a, b, c, d);
Console.WriteLine(x);
Console.WriteLine(y);
Console.ReadLine();
}
}
}
我理想中的运算值应该是x=14,y=8
但是总是显示x=14,y=14
就是说y的值没有返回过来
请问怎么在dll文件的函数里面返回多个值呢?
本人菜鸟,谢谢各位大神的指导