C# Equivalent code for C++
-
Hi All, Can you please give me the equivalent code in C# for the following? unsigned char CardType[2]; stu = MF_Request(DeviceAddr, 0, CardType); Message("Request Card", stu); String str; char code[100]; if (stu == 0) { str = " ==> CardType(Hex): "; sprintf(code,"%02X%02X",CardType[0],CardType[1]); str += code; } Thanks in Advance :)shahtech:)
-
Hi All, Can you please give me the equivalent code in C# for the following? unsigned char CardType[2]; stu = MF_Request(DeviceAddr, 0, CardType); Message("Request Card", stu); String str; char code[100]; if (stu == 0) { str = " ==> CardType(Hex): "; sprintf(code,"%02X%02X",CardType[0],CardType[1]); str += code; } Thanks in Advance :)shahtech:)
What's the problem? If you have an equivalent for the MF_Request function (which I have no idea what it is), the translation is trivial.
-
What's the problem? If you have an equivalent for the MF_Request function (which I have no idea what it is), the translation is trivial.
-
Hi All, Can you please give me the equivalent code in C# for the following? unsigned char CardType[2]; stu = MF_Request(DeviceAddr, 0, CardType); Message("Request Card", stu); String str; char code[100]; if (stu == 0) { str = " ==> CardType(Hex): "; sprintf(code,"%02X%02X",CardType[0],CardType[1]); str += code; } Thanks in Advance :)shahtech:)
byte[] CardType = new byte[2];
stu = MF_Request(DeviceAddr, 0, CardType);
Message("Request Card", stu);string str = null;
if (stu == 0) {
str = string.Format(" ==> CardType(Hex): {0:x2}{1:x2}", CardType[0], CardType[1]);
}Despite everything, the person most likely to be fooling you next is yourself.
-
Hi All, Can you please give me the equivalent code in C# for the following? unsigned char CardType[2]; stu = MF_Request(DeviceAddr, 0, CardType); Message("Request Card", stu); String str; char code[100]; if (stu == 0) { str = " ==> CardType(Hex): "; sprintf(code,"%02X%02X",CardType[0],CardType[1]); str += code; } Thanks in Advance :)shahtech:)
(via C++ to C# Converter): byte[] CardType = new byte[2]; stu = MF_Request(DeviceAddr, 0, CardType); Message("Request Card", stu); string str; string code = new string(new char[100]); if (stu == 0) { str = " ==> CardType(Hex): "; code = string.Format("{0:X2}{1:X2}", CardType[0], CardType[1]); str += code; }
David Anton http://www.tangiblesoftwaresolutions.com C++ to C# Converter C++ to VB Converter C++ to Java Converter VB & C# to Java Converter Java to VB & C# Converter Instant C#: VB to C# converter Instant VB: C# to VB converter Instant C++: convert VB, C#, or Java to C++/CLI