C# Tips
来源:互联网 发布:淘宝冠军店铺 编辑:程序博客网 时间:2024/05/08 13:40
1. 十六进制和十进制的相互转换
//z 2011-12-28 5:37 PM is2120@csdn
int decValue = 2120;
将十进制转换为 十六进制
string hexValue =decValue.ToString("X");
将十六进制转回十进制
int decAgain = int.Parse(hexValue,System.Globalization.NumberStyles.HexNumber);
2. Input string was not in a correct format.
Unhandled Exception: System.FormatException: Input string was not in a correct format.
at System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolea
n parseDecimal)
at System.Number.ParseInt32(String s, NumberStyles style, NumberFormatInfo info)
//z 2011-12-28 5:40 PM is2120@csdn
出现这个错误的几种情况:
int.Parse (“”);
int.Parse (null);
int.Parse (string.Empty);
int.Parse ("2120D@is2120");
//z 2011-12-28 5:40 PM is2120@csdn
3. 得到当前方法相关信息
System.Reflection.MethodBase.GetCurrentMethod()
//z 2011-12-28 5:37 PM is2120@csdn
int decValue = 2120;
将十进制转换为 十六进制
string hexValue =decValue.ToString("X");
将十六进制转回十进制
int decAgain = int.Parse(hexValue,System.Globalization.NumberStyles.HexNumber);
2. Input string was not in a correct format.
Unhandled Exception: System.FormatException: Input string was not in a correct format.
at System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolea
n parseDecimal)
at System.Number.ParseInt32(String s, NumberStyles style, NumberFormatInfo info)
//z 2011-12-28 5:40 PM is2120@csdn
出现这个错误的几种情况:
int.Parse (“”);
int.Parse (null);
int.Parse (string.Empty);
int.Parse ("2120D@is2120");
//z 2011-12-28 5:40 PM is2120@csdn
3. 得到当前方法相关信息
System.Reflection.MethodBase.GetCurrentMethod()
- C# tips
- C# Tips
- C# tips
- C# Tips
- Tips-C#
- c#数据库连接小tips
- C# Tips:UInt64MaskHelper
- C#高效编程TIPS
- C# Tips: ICloneable<T>
- C#使用Tips(部分)
- C# webbrowser 使用Tips
- C# Programming tips (2) Generics
- C# Tips:位运算相关
- C# Tips:Sort a list
- C# 网络通讯乱码问题解决小tips
- ASP.NET MVC/C#开发Tips记录。
- Tips
- Tips
- 字符集和字符编码区别
- SIP tech-invite
- android pull 解析xml方式
- 使用AXD调试MMU地址映射程序手记
- 对世界的一些认识
- C# Tips
- 普适计算领域,位置可以做什么?
- PHP多进程编程
- SSH分页
- 通话处理流程(从上到下)
- PHP CLI模式下的多进程应用
- NSString 到 unicode asic utf-8 gbk
- Gentoo Linux设置文本模式下的分辨率
- Div+CSS优点