是否可以使用字符串?我读到有必要使用Pchar,但无法找到使其工作的方法。 这是DLL代码:
function DeCrypt( Mensagem: String;): String; export; StdCall;
var
P,
Q: Array[1..2] of string;
i: integer;
begin
{Blocos criptografados}
P[1] := Copy(Mensagem,7,2) + Copy(Mensagem,12,2);
P[2] := Copy(Mensagem,8,4) + Copy(Mensagem,29,3);
for i:= 1 to 2 do
Q[i] := Decodifica(P[i]);
Result := Copy(Mensagem,1,19) +
Copy(Q[1],5,2) + Copy(Q[2],5,2) + Copy(Q[3],5,2) + '000' +
Copy(Q[1],2,3) + Copy(Q[2],2,3) + Copy(Q[3],2,3);
end;
exports DeCrypt;
这是我的C#代码
private void button1_Click(object sender, EventArgs e)
{
string aux = textBox1.Text;
string aux2 = "";
aux2 = DeCrypt(aux);
}
textBox2.Text = aux2;
}