最近我发现了C#,这才是我想要的。在C#之前我用AS3编写代码。我用C#重新编写了所有旧程序,但我被阻止了:
public function Envoie_Serveur(param1:String) : void
{
var _loc_2:* = String(this.CMDTEC % 9000 + 1000).split("");
this.Serveur.send(this.MDT[_loc_2[0]] + this.MDT[_loc_2[1]] + this.MDT[_loc_2[2]] + this.MDT[_loc_2[3]] + param1);
var _loc_3:* = this;
var _loc_4:* = this.CMDTEC + 1;
_loc_3.CMDTEC = _loc_4;
return;
}
CMDTEC and MDT are 2 byteArray (byte[] in C# I guess)
这就是我尝试但不起作用的内容; c
byte[] _loc_1 = Encode((Int64.Parse(this.CMDTEC[0].ToString("X", System.Globalization.NumberStyles.HexNumber)) % 9000 + 1000) + "");
var fingerprint = new byte[4];
fingerprint[0] = byte.Parse(this.MDT[_loc_1[0]].ToString("X"), System.Globalization.NumberStyles.HexNumber);
fingerprint[1] = byte.Parse(this.MDT[_loc_1[1]].ToString("X"), System.Globalization.NumberStyles.HexNumber);
fingerprint[2] = byte.Parse(this.MDT[_loc_1[2]].ToString("X"), System.Globalization.NumberStyles.HexNumber);
fingerprint[3] = byte.Parse(this.MDT[_loc_1[3]].ToString("X"), System.Globalization.NumberStyles.HexNumber);
this.CMDTEC++;
例如,这就是CMDTEC和MDT所包含的内容:
this.MDT = "1400175151406"; (just for exemple, I get this by socket)
this.CMDTEC = "8306"; (idem as ^)
如何正确转换为C#请?提前感谢您的回答。