开发者

How to Convert VB hex to c# hex

开发者 https://www.devze.com 2023-03-16 03:52 出处:网络
How do I convert this from VB.Net to c#? 开发者_如何学GoDim dd As String = Hex(ExpiryDate.Value.Day).PadLeft(4, \"0\")

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);
0

精彩评论

暂无评论...
验证码 换一张
取 消