コード例 #1
0
        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));
        }
コード例 #2
0
        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));
        }
コード例 #3
0
ファイル: AttachData.cs プロジェクト: lexzh/Myproject
        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);
        }
コード例 #4
0
 public static string ConvertStringToDatetime(string sDateTime)
 {
     return(NumHelper.ConvertToDatetime((long)NumHelper.Convert16To10(sDateTime)));
 }
コード例 #5
0
 public static string Convert16To10ToString(string str)
 {
     return(((long)NumHelper.Convert16To10(str)).ToString());
 }