How to Convert VB hex to c# hex
How do I convert this from VB.Net to c#?
开发者_如何学GoDim dd As String = Hex(ExpiryDate.Value.Day).PadLeft(4, "0")
I tried a conversion tool (It uses the mono project source code they say) http://www.developerfusion.com/tools/convert/vb-to-csharp/
and it came up with this but c# does not like it. - the code that is.
string dd = Conversion.Hex(ExpiryDate.Value.Day).PadLeft(4, "0");
This is the error:-
The name 'Conversion' does not exist in the current context
This might be what you want:
string dd = String.Format("{0:x4}", ExpiryDate.Value.Day);
精彩评论