public static string GetIPFrom16to10(string str) { string empty = string.Empty; for (int i = 0; i < str.Length; i = i + 2) { empty = string.Concat(empty, ".", Convert.ToString(NumHelper.Convert16To10(str.Substring(i, 2)))); } return(empty.Substring(1)); }
public static string GetPosInfo(string subTxt) { int num = NumHelper.Convert16To10(subTxt.Substring(0, 8)); int num1 = NumHelper.Convert16To10(subTxt.Substring(8, 8)); int num2 = Convert.ToInt16(subTxt.Substring(16, 4), 16); object[] str = new object[5]; double num3 = (double)num * 0.0001 / 60; str[0] = num3.ToString("F6"); str[1] = ","; double num4 = (double)num1 * 0.0001 / 60; str[2] = num4.ToString("F6"); str[3] = ","; str[4] = num2; return(string.Concat(str)); }
private string Parse(string dataType, string dataText, string otherinfo) { string empty = string.Empty; string str = dataType; string str1 = str; if (str != null) { if (str1 == "1") { long num = Convert.ToInt64(dataText) >> 32; decimal num1 = Math.Round(num / new decimal(100), 2); empty = num1.ToString(); } else if (str1 == "01") { double num2 = (double)NumHelper.Convert16To10(dataText.Substring(0, 8)) * 0.01; empty = num2.ToString(); } else if (str1 != "D1") { if (str1 != "22") { } } else if (otherinfo != "0") { DoorState doorState = new DoorState(1) { MessageAlarmText = dataText }; empty = doorState.Parse(); } else { DoorState doorState1 = new DoorState(0) { MessageAlarmText = dataText }; empty = doorState1.Parse(); } } return(empty); }
public static string ConvertStringToDatetime(string sDateTime) { return(NumHelper.ConvertToDatetime((long)NumHelper.Convert16To10(sDateTime))); }
public static string Convert16To10ToString(string str) { return(((long)NumHelper.Convert16To10(str)).ToString()); }