我有一个EBCDIC格式的值“000000 {”.我想把它转换成一个.NET Int32类型.有谁能让我知道我能做些什么吗?所以我的问题是给出一个包含EBCDIC中一个有符号数字的字符串,我该怎么做才能将它转换成.NET Int32.
非常感谢!
解决方法
尝试这个
#region public static byte[] ConvertAsciiToEbcdic(byte[] asciiData) public static byte[] ConvertAsciiToEbcdic(byte[] asciiData) { // Create two different encodings. Encoding ascii = Encoding.ASCII; Encoding ebcdic = Encoding.GetEncoding("IBM037"); //Retutn Ebcdic Data return Encoding.Convert(ascii,ebcdic,asciiData); } #endregion #region public static byte[] ConvertEbcdicToAscii(byte[] ebcdicData) public static byte[] ConvertEbcdicToAscii(byte[] ebcdicData) { // Create two different encodings. Encoding ascii = Encoding.ASCII; Encoding ebcdic = Encoding.GetEncoding("IBM037"); //Retutn Ascii Data return Encoding.Convert(ebcdic,ascii,ebcdicData); } #endregion